MS Access & SQL Date Formats

J

John Whitworth

I am using the following SQL in my ASP webpage, to access an Access
database:

SQLQuery = "SELECT * FROM Church WHERE (LastUpdate BETWEEN #" &
SinceDate & "# AND #" & Today & "#) ORDER BY LastUpdate DESC"

I am getting problems with date formatting. My database has the date
stored as DD/MM/YYYY, and, when the DD component is greater than 12,
this works correctly. However, it seems that when the date component is
12 or less, somewhere along the line, a format of MM/DD/YYYY is being used.

How do I force comparisons to take place in DD/MM/YYYY format with query?

Thanks

John
 
K

Kathleen Anderson [MVP - FrontPage]

It sounds like this may be an issue with the locale setting on your server.
Do you know where (what country) your web server is located in?

--

~ Kathleen Anderson
Microsoft FrontPage MVP
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/
 
J

John Whitworth

Kathleen said:
It sounds like this may be an issue with the locale setting on your server.
Do you know where (what country) your web server is located in?
Hi Kathleen,

I think the server is based in Germany.

I have managed to fix the problem, using a rather roundabout method. I
reformatted the dates I was using to check between into US format, using
good old fashioned Left, Right and Mid!! I tried all sorts of formatting
functions, but got nowhere!

Thanks

John
 

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