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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2007 changing dates to US format

Status
Not open for further replies.

LondonJohn

Instructor
Sep 1, 2000
16
GB
We have a client with two sites that we have done some simple access databases for and both have upgraded to Access 2007 (without telling us!) They are having problems with dates - although the system is set to UK dates there are issues with Access changing some dates to US format.
Has anybody else had any experience of this?
 




A DATE is a DATE. Date Values are just NUMBERS. The DateValue today is 39528.

The Display Format is just that; how the DateValue is displayed.

The DateValue, 39528, can be FORMATTED to DISPLAY 03/21/2008 or 21/03/2008 or 2008/03/21 or any number of other DISPLAY FORMATS.

Skip,
[sub]
[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue][/sub]
 
Are you sure that your databases are respecting the user's regional date settings? I.e., have you set the display properties to "short date" or something like "mm/dd/yyyy"?

 
You may have the date problem when using SQL statements to make queries in your VB codes. the date you are using in SQL statements are considered as US format, so you will have a conflict if you system date format is different. for example read the system date using Now() function and pass it to a SQL statement.

I solved this problem by converting any date before passing it to the SQL statements I used in VB codes.
You can use the following code lines to read and convert the system date to the US format mm/dd/YYYY:
'''''''''''''''''''''''''''''
Dim strDate As String
Dim Date As Date
strDate= DatePart("m", Now()) &"/"& DatePart("d", Now()) _ &"/"& DatePart("yyyy", Now())
Date= strDate 'US Format
''''''''''''''''''''''''''''''
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top