Full Version: Access Displays Dates Incorrectly If Not Explicitly Formatted
UtterAccess Discussion Forums > Microsoft® Access > Access Date + Time
r0bertdenir0
Hi,

I'm having a weird problem with date fields in Access 2007.
When the format is not explicitly set, it defaults to General Date.
This built in format is displaying dates incorrectly.

For example, 04 Nov 2010 01:26:54 PM displays as 04 Nov 10308 01:26:54 PM
and 15 Nov 2010 02:33:54 PM displays as 15 Nov 10319 02:33:54 PM
This happens in datasheet view & form controls.

If I explicitly format any date fields or controls using dd a format like mmm yyyy hh:nn ampm it displays correctly.
BUT if you edit the field by clicking in it or pressing F2, you have to edit the date in the incorrect format.
When you leave the control it is displayed correctly again.

Looking at the difference in these numbers it seems like Access is mixing up dates with days.
I've looked in the Windows Control Panel & my Regional Settings are fine - the rest of my system is displaying dates correctly.



Gustav
Yes, somewhere yyy is used for yyyy.
Did you check your settings in Windows?

/gustav
r0bertdenir0
Thanks Gustav.

That sorted it out. I double checked my Regional Settings & the Short Date format was set to yyy instead of yyyy
Oddly the first time I tried it with Access open & the dates were correct instantaneously but the DateTime Picker controls gave an error so I closed the database & reopened it.
Then the dates were wrong again. I went back to Control panel & found somehow my Date settings had been changed back to yyy!
On the 2nd attempt everything is working & the settings seems to be sticking.

Thanks again.
Gustav
You are welcome!

/gustav
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.