Converting a date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an input field which allows an input of DD/MM/YYYY, this then goes
into a VBA SQL query which converts the inputted numbers to MM/DD/YYYY.

How do I stop this?

Cheers Nick
 
Hi,
perhaps you trying to convert it to date type?
try to operate with it like a string
 
I need it to be a date type as the fields it is referencing are date type
fields.

Cheers Nick
 
Regardless of what your Regional Settings may be set to, Access expects
mm/dd/yyyy format in SQL statements. Simply explicitly format the input,
using Format([MyValue], "\#mm\/dd\/yyyy\#")

You might find it useful to read Allen Browne's "International Dates in
Access" at http://allenbrowne.com/ser-36.html or what I had in my September
2003 "Access Answers" column for Pinnacle Publication's "Smart Access"
newsletter. (The column and accompanying database can be downloaded for free
at http://www.accessmvp.com/djsteele/SmartAccess.html)
 
Thanks, that has worked a treat

Douglas J Steele said:
Regardless of what your Regional Settings may be set to, Access expects
mm/dd/yyyy format in SQL statements. Simply explicitly format the input,
using Format([MyValue], "\#mm\/dd\/yyyy\#")

You might find it useful to read Allen Browne's "International Dates in
Access" at http://allenbrowne.com/ser-36.html or what I had in my September
2003 "Access Answers" column for Pinnacle Publication's "Smart Access"
newsletter. (The column and accompanying database can be downloaded for free
at http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Nick said:
I have an input field which allows an input of DD/MM/YYYY, this then goes
into a VBA SQL query which converts the inputted numbers to MM/DD/YYYY.

How do I stop this?

Cheers Nick
 
Back
Top