Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 28th, 2003, 06:49 AM
Registered User
 
Join Date: Aug 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL and Date Formats

I have a table which contains dates in the format of dd/mm/yyyy.
I have a field on a form with a date format of dd/mm/yyyy.
If i try to reference the two together via sql, with the Form field value of 14/03/2002 SQL will treat this value correctly and understand it as 14th March 2002.
However, if the value is 12/03/2002 SQL will understand it as 3rd December 2002.
Clearly SQL's default date format is American Standard.
What can I put in my SQL to force it to run as dd/mm/yyyy ?
Thanks
 
Old August 28th, 2003, 07:37 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: Houston, Texas, USA.
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

View the article at the following link:

http://www.flws.com.au/showusyourcod...te.asp?catID=3

There is also a work around. SQL and Access store date formats as mm/dd/yyyy. If you pass the values to SQL or Access as dd/mmm/yyyy then all is fine.

HTH,

Beth M
 
Old August 28th, 2003, 08:32 AM
Authorized User
 
Join Date: Jun 2003
Location: , Quebec, Canada.
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You should use the ISO format: yyyy/mm/dd. This way, you won't have any problem. Also read this topic http://p2p.wrox.com/topic.asp?TOPIC_ID=3144


St├ęphane Lajoie
 
Old August 28th, 2003, 08:45 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: Houston, Texas, USA.
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Allen Browne also has some information regarding date formats:

http://users.bigpond.net.au/abrowne1/ser-36.html

Regards,

Beth M




Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Formats carumuga SQL Server 2000 4 January 2nd, 2007 07:20 PM
XML Date Formats tracyamgray XSLT 5 July 12th, 2006 10:17 PM
Trouble with date formats DrewMills Access VBA 3 March 7th, 2005 06:22 PM
Custom Date Formats in an XSD francislang XML 3 September 13th, 2004 11:47 AM
Date formats in the forum Crispin Horsfield Forum and Wrox.com Feedback 1 August 3rd, 2003 08:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.