Apparently it's OK to say 'yyyy.MM.dd' in SQL, but I get an "exception of type 'System.Data.OleDb.OleDbException' " when I try it in C# with an Access DB. Same for every other format I've tried.
It seems that inserting dates into MS SQL Server can be a fairly code-consuming process if you want to do it in Italian. Is there a standard way to do this sort of thing? Will always using the US format work?
MySQL seems to support the semi-standard yyyy-MM-dd format. Does Access?
I'm writing code here in New Zealand that I don't want to blow up when someone somewhere else runs it. Where is the official, 'safe' way to do it?!
(If anyone can find me the MS Jet version of this page, please drop me a line!)
For the moment I'm querying like this:
SELECT * FROM foo WHERE DAY(bar)=3 AND MONTH(bar)=6 AND YEAR(bar)=2002
It's not pretty, but it works.
12:19:06 AM
|