Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change in Date format in Access 2007?

Status
Not open for further replies.

calvi

Technical User
May 26, 2003
87
NL
I am using MS Access 2007 European(dutch) version. I was told that before 1st of May 2010 when I sql select query in VBA code it is working fine with eg. "Select * from table where date = 25-4-2010"; The database will get this as (25th of april 2010). But after 1st of may 2010 when you put the date as "Select * from table where date = 4-5-2010"; the database will get this as 5th of april 2010 instead of 4th of may 2010.
Also I discover when I put in querytable the criteria as #4-5-2010# (4th of may), the sqlview will convert this to #5-4-2010# (5th of april).
So to make sure when you put the date in the application and convert it to the database correctly I format the date in VBA code: ("Select * from table WHERE date = #" & Format(datDate, "mm/dd/yyyy") & "#") This will convert correctly in the database record. But will this work fine in the future? Because before 1st of may 2010 I haven't format datDate in VBA code, and it worked fine. Is there a change in MS Access 2007 itself, may be the dutch version? Can I be ensured that it will work fine in the following period with the Format change and that MS Access 2007 will not change the format?
 
Use non ambiguous format:
WHERE date = #" & Format(datDate, "yyyy-mm-dd") & "#")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top