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!

inserting dates into access problem

Status
Not open for further replies.

stinkybee

Programmer
May 15, 2001
218
GB
I am trying to insert dates into my access database in the format dd/mm/yyyy.

However, it appears to swap the day and month around when inserting the values to mm/dd/yyyy. For example, if I enter 01/03/2006 it will insert 03/01/2006 into the database.

I have set the locale to UK in my asp script and my computer and server are both set for UK date formats. All other access databases on my server work with the correct format.

I can not work out what the problem is, does anyone have a solution for this?
 
I believe you can force the desired format via the VBScript format function:
Format(Date, "MM/DD/YYYY")

Not sure if there's a simpler way...
 
Yup, ChrisHirst is correct. That's one of the MANY annoying little difference between VB and VBScript that constantly trip me up.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top