Stumped By Dates

June 08th, 2012 - 08:39 am ET by TeeSee | Report spam
Access 2003, WIN 7, Regional settings= English, Canada

No matter what I try formatting date field in tables, formatting or
not during insert to tables using strDate = "#" & mydate & "#" Icannot
get the table updated to dd-mm-yyy. The following is a trial SQL print
out that looks correct and Insert to the table okay but in mm/dd/yyyy
format

INSERT INTO tblDates(dtmDate1,dtmDate2)VALUES(#04/06/2012#,
#11/06/2012#) The dates are the fourth and eleventh of June 2012.
When inserted to the tbl they show as 06/04/2012 etc.
This seems to have started when I changed from XP to Win 7
Could someone please advise how to correct.

Thank you
email Follow the discussionReplies 4 repliesReplies Make a reply

Replies

#1 Access Developer
June 08th, 2012 - 01:00 pm ET | Report spam
The reason you cannot get the Table updated to "dd-mm-yyy" is that dates are
not stored as characters in formatted form -- they are stored as a number...
looks like a double precision floating point, but for dates, interpreted
with the whole number part representing date as number of days since Dec.
30, 1899 and the fractional part representing seconds since last midnight.

What is presented to you is that number with a format applied... either your
regional format, format in the table, format applied to the control on a
form, or a specific format used in a function. And many of us (I, for one)
have to review the precedence of the formats when we don't see what we
expect.

Unless someone has "slipped a change by me" in some recent version, if you
specify a date in a Query, you must use US date format, that is mmddyy or
mmddyyyy.

Larry Linson
Microsoft Office Access MVP
Co-Author, Microsoft Access Small Business Solutions, Wiley 2010

"TeeSee" wrote in message
news:
Access 2003, WIN 7, Regional settings= English, Canada

No matter what I try formatting date field in tables, formatting or
not during insert to tables using strDate = "#" & mydate & "#" Icannot
get the table updated to dd-mm-yyy. The following is a trial SQL print
out that looks correct and Insert to the table okay but in mm/dd/yyyy
format

INSERT INTO tblDates(dtmDate1,dtmDate2)VALUES(#04/06/2012#,
#11/06/2012#) The dates are the fourth and eleventh of June 2012.
When inserted to the tbl they show as 06/04/2012 etc.
This seems to have started when I changed from XP to Win 7
Could someone please advise how to correct.

Thank you

Similar topics