The 'Date' meets 'SQL' on a bad day...

Carl_R

Registered User.
Local time
Today, 16:51
Joined
Aug 16, 2002
Messages
82
Hi
Read through the many posts related to this topic but still can't get my brain around this.

I have the following SQL statement:

stSQL = stSQL & " WHERE (((tblChanges.ImplementationDate)=#" & CDate(txtSelectDate) & "#));"

When the txtSelectDate is passed in format dd/mm/yyyy, the report is generated but no records are found.

If the date is entered in US format mm/dd/yyyy, the report is generated with the correct records (in format dd/mm/yyyy - I guess the European format is being picked up by my PC's Regional Settings).

Question is, how do I alter my SQL so users can enter the date in dd/mm/yyyy (and not mm/dd/yyyy) format to retrieve their records?
 
MyDate = txtSelectDate
stSQL = stSQL & " WHERE (((tblChanges.ImplementationDate)=#" & format(MyDate,"mm/dd/yy") & "#));"

HTH
 

Users who are viewing this thread

Back
Top Bottom