Between ... and ...

S

stelios

Hi,

I have a query in a DAO recordset which have the parameter <<Between
[indate] and [outdate]>>. The dates have the British format "dd/mm/yyyy" (my
fields are saved in the tables at this format).
When I run the query by code I have wrong results! If I transfer the SQL
syntax, with copy-paste, in the access's "design view" I see that the date
changes in USA's format.
Is there a way to avoid it?
(This moment I use the function <<format(indate,"mm/dd/yyyy")>> and the
access recognize the date as British (it changes the "mm"->"dd" and vise
versa) so I get the right records .... I think!!!! ...... Is this way
right?)

Thanks
 
A

Allen Browne

See:
International Date Formats in Access
at:
http://allenbrowne.com/ser-36.html

The article explains that you must use the mm/dd/yyyy format and delimit
with # for literal values in a SQL clause, regardless of your regional
settings, and explains how to avoid the 3 cases where Access is likely to
misunderstand your dd/mm/yyyy date entries.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top