We are in the process of switching from Access to MySQL using an ASP app so I worte this script to translate dates into the MySQL format.
- Code: Select all
private function mySQLDate(oldDate)
dim y
dim mo
dim d
dim h
dim m
dim s
dim return
if isdate(oldDate) then
y = datepart("yyyy", oldDate)
mo = datepart("m", oldDate)
d = datepart("d", oldDate)
h = datepart("h", oldDate)
m = datepart("n", oldDate)
s = datepart("s", oldDate)
return = join(array(y, mo, d), "-")
if h+m+s > 0 then return = return & " " & join(array(h, m, s), ":")
end if
mySQLDate = return
end function
No warrently express or implied.

HTH