Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
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
Reply With Quote
  #3 (permalink)  
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
Reply With Quote
  #4 (permalink)  
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:30 PM.


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