MS Access Date/Time field - American/English 
Author Message
 MS Access Date/Time field - American/English

Wonder if anybody has a solution around this problem that I now seem to be
experiencing.

Microsoft Access 97 > Dat/Time Field.

In my previous database data import I could search the "CreatedDate"
(Date/Time) field as follows: -

WHERE CreatedDate BETWEEN #07/10/2001# AND #03/11/2001#  (7th October to 3rd
November)

For some strange reason the latest data import has some how changed the
database locale and I'm no longer able to search for dates in the English
date format rather I have to now use: -

WHERE CreatedDate BETWEEN #10/07/2001# AND #11/03/2001# (7th October to 3rd
November)

I would hapilly stick to the American standard of date searches if I knew
for certain that it will not change once again in the future back the the
British format so... my question is this.  Is it possible to detect a
database locale using ADO or any other similar technique before performing
searches.

Thanks in advance,

Ian Ashworth



Fri, 07 May 2004 21:41:19 GMT  
 MS Access Date/Time field - American/English
I don't have any experience with the different situations so I don't when you
need to use this method but you can check which system is in effect for the
format statement with the following code.
Dim dte As Date, s1 As String, l1 As Long
dte = CDate("7/4/2001")
l1 = dte
s1 = Format(dte, "Long Date") & " " & l1
MsgBox s1
The date is stored as the number of days from some reference date and as the
code shows, can be converted to an integer. If  l1 = 37076 then the US system is
being used, if l1=36899 then the United Kingdom system is being used. Bobby
Quote:

> Wonder if anybody has a solution around this problem that I now seem to be
> experiencing.

> Microsoft Access 97 > Dat/Time Field.

> In my previous database data import I could search the "CreatedDate"
> (Date/Time) field as follows: -

> WHERE CreatedDate BETWEEN #07/10/2001# AND #03/11/2001#  (7th October to 3rd
> November)

> For some strange reason the latest data import has some how changed the
> database locale and I'm no longer able to search for dates in the English
> date format rather I have to now use: -

> WHERE CreatedDate BETWEEN #10/07/2001# AND #11/03/2001# (7th October to 3rd
> November)

> I would hapilly stick to the American standard of date searches if I knew
> for certain that it will not change once again in the future back the the
> British format so... my question is this.  Is it possible to detect a
> database locale using ADO or any other similar technique before performing
> searches.

> Thanks in advance,

> Ian Ashworth



Sat, 08 May 2004 04:57:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP: American date format when it should be Irish/English

2. ADO with Access Date/Time field not storing the time, just the date

3. Insert date and time field into MS Access with SQL

4. CRW with MS Access 2.0 date/time fields

5. MS Access Date/Time Field in Crystal

6. How do I store an empty date on a date field (MS Access)

7. Null date values in Date/Time fields in Access DB

8. bound masked field to date/time field in access not formatting right

9. Matching system date/time with field date/time

10. American/English coversion

11. HELP with DATE/TIME field from MS-Access97

12. Date and Time in MS Access

 

 
Powered by phpBB® Forum Software