Updated: 15/09/2002; 12:48:40 a.m..
Python Community Server (development progress)
A weblog about programming in Python, C#, Java, Perl and C++ - and the occasional comment on PyCS development
        

Tuesday, 4 June 2002

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    comment []


© Copyright 2002 Phillip Pearson.
 
June 2002
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
May   Jul

[Macro error: Can't render navigator links because an error occurred: "The file "C:\Program Files\Radio UserLand\www\#navigatorLinks.xml" wasn't found.".]
Click here to visit the Radio UserLand website.

Subscribe to "Python Community Server (development progress)" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.