Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Home > Courses > Access > Developer > D05 > SQL Date Format by Stephen Laycock >
Back to Access Developer 5    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
SQL Date Format
Stephen Laycock 
    
2 years ago
Have any other Brits had the same problem as me with the date format when updating the CommissionCheckT table with the Process Check Button in Developer_5 video_3?
The DoCmd.RunSQL code kept swapping the day and month around, and consequently giving me the wrong date in the table..

Turns out, in SQL, the dates are interpreted in the (MM/DD/YYYY) format by default when using the '#' delimiters, regardless of your Country's system settings.
The following answer from chatGPT corrected it: -

Dim FormattedDate As String
FormattedDate = Format(Date, "MM/DD/YYYY")
    DoCmd.RunSQL "INSERT INTO CommissionChequeT " & _
        " (ChequeDate, Amount, EmployeeID) VALUES " & _
        " (# " & FormattedDate & " #, " & Total2 & ", " & EmployeeCombo & ") "

Will I always have to do this every time I use a #Date# input in a SQL statement, or is there a better way?
Kevin Robertson  @Reply  
          
2 years ago
Juan C Rivera  @Reply  
            
2 years ago
I had a problem and its all software related, and yes you will need to do this everytime.  took me a long time untill someone else on the forum had the same problem.  but like Kevin pointed switch to ISO and we can all be on the same path towards Richards goal to change the world.  LOL
Stephen Laycock OP  @Reply  
    
2 years ago
Thanks, I'll give ISO a try.
Richard Rost  @Reply  
          
2 years ago
Changing the world... One bad query at a time...

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 5.
 

Next Unseen

 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 9/25/2026 1:42:52 AM. PLT: 1s