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

Date format discrepancy 1

Status
Not open for further replies.

AOLBoy

IS-IT--Management
May 7, 2002
68
GB
I'm having some trouble with dates.

I am writing a VB6 application and using MS Access.

When I write a date say 10/3/2006 (UK format) to my database it appears as 03/10/2006 (US Format) on the file.

Are there any settings I need to change in Access? if not is there any recognised procedure to overcome this problem?

Thanks
 
Internally the JET database engine uses US format (mm/dd/yyyy) to convert strings to dates if there's some ambiguity in the format (such as a day <= 12.) You can't change that but you can use some unambiguous format such as "10/Mar/2006" or "2006-03-10" (ANSI Standard).
 
Use a DateTime Picker so that there is no mistakes. You can convert it to internal DATE format, which can't be misunderstood.

It saves headaches. You can pre-populate the default day, and if you have a From and To, you can choose the default TO day the same as the FROM day.

-David
2006 Microsoft Valueable Professional (MVP)
2006 Dell Certified System Professional (CSP)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top