Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UK Dates via ODBC 1

Status
Not open for further replies.

rmtweb

Programmer
Feb 27, 2004
2
GB
I have an Access Database which uses UK Dates.

I run the following SQLString in an ASP page with the intention of displaying all Start Dates in February:

SQLString = "SELECT * FROM ClientData WHERE StartDate BETWEEN #01/02/2004# AND #28/02/2004#"

However, what I get is results for all dates between 2nd JANUARY and 28th February!! For some reason ODBC is changing one of my dates to a US Date. How can I set the date format for ODBC to use UK Dates only?

The Windows 2000 Server Machine Location is Set to UK Dates, Access is set to UK Dates. I cannot find any reason why this should be!

A similar effect happens when outputting a UK Date from the database to the screen (for example)

Date in Database: 02/03/2004

Output on screen: 03/02/2004

It "Americanizes" the dates every time it is accessed via ODBC which leads me to think that this is where the problems lies. Please please please can anyone help!

Thanks!
 
Use the format



SQLString = "SELECT * FROM ClientData WHERE StartDate BETWEEN '1 February 2004' AND '28 February 2004'"


(btw - this is a leap year)

hth

simon


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top