Adrienne Boswell wrote on 23 okt 2007 in
microsoft.public.inetserver.asp.general:
The coding differences between MySQL and MSSQL are few, but important.
For example, date() in ASP produces MM-DD-YYYY, and MySQL stores dates
as YYYY-MM-DD.
All these database engines store date/time in some internal format,
inconsequential to the programmer. [except for the resolution]
ASP dos not produce any format, as it is just a platform.
ASP vbscript date-to-string conversion,
and ASP jscript date-to-string conversion,
convert a date/time value to a string,
depending on the operating system's regional settings.
So
vbscript date() does not produce this MM-DD-YYYY format,
it just returns the date/time value in internal format.
The date-to-string conversion,
as used by response.write() because it needs a string as parameter,
does that on your machine with your regional settings.
For entering a date/time by way of a SQL string,
it is important to know what the SQL engine accepts as data/time strings,
I would hope all engines accept YYYY-MM-DD and YYYY/MM/DD.
The error prone MM-DD-YYYY should not even be considered as SQL input
by any serious programmer.
=====================
So under Jet/Access, ASP/vbscript
:
myDate = #2007-10-23#
sql = "... [date] = #" & myDate & "#;"
would involve the peculiarities of the regional settings,
introduced by the date-to-string conversion,
that could(!) be inconsistent with the Jet engine,
while this would not:
myDate = "2007-10-23"
sql = "... [date] = #" & myDate & "#;"
[Bob will correct me where I am wrong]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)