PC Review


Reply
Thread Tools Rate Thread

Access should always treat dates with year first in ISO format

 
 
=?Utf-8?B?Y29vbHZpZA==?=
Guest
Posts: n/a
 
      10th Apr 2006
Different machines can be configured to use different languages. This is
particularly a problem as the Windows setup Wizard makes you have to change
the language/regional settings in no fewer than 4 places, and non-savvy users
do not realise that this is the case.

You therefore end up with one computer set to US an one to GB. This means a
date like 09/03/2006 can be misinterpreted, as the standard monotonic
interpretation (i.e. 9th March 2006) is reveresed in the US (i.e. DD/MM/YYYY
is the GB setting, but MM/DD/YYYY is the US setting).

To get around this on most (other) database systems one can enter the date
in the ISO format YYYY-MM-DD, e.g. 2006-03-09 always means the 9th March.
However in Access and SQL Server this is sometimes, seemingly irratically
interpreted as the 3rd September.

Since the behaviour is inconsistent, it is nigh on impossible to write code
with predictable results causing severe embarrassment with clients.

Also, occasionally, a time is displayed in a field where a date is entered
for apparently no good reason.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm....modulesdaovba
 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      10th Apr 2006
coolvid wrote:
> Different machines can be configured to use different languages.
> This is particularly a problem as the Windows setup Wizard makes you
> have to change the language/regional settings in no fewer than 4
> places, and non-savvy users do not realise that this is the case.
>
> You therefore end up with one computer set to US an one to GB. This
> means a date like 09/03/2006 can be misinterpreted, as the standard
> monotonic interpretation (i.e. 9th March 2006) is reveresed in the US
> (i.e. DD/MM/YYYY is the GB setting, but MM/DD/YYYY is the US setting).
>
> To get around this on most (other) database systems one can enter the
> date in the ISO format YYYY-MM-DD, e.g. 2006-03-09 always means the
> 9th March. However in Access and SQL Server this is sometimes,
> seemingly irratically interpreted as the 3rd September.
>
> Since the behaviour is inconsistent, it is nigh on impossible to
> write code with predictable results causing severe embarrassment with
> clients.


I have never seen Access nor SQL Server interpret a date formatted as
0000-00-00 as anything but YYYY-MM-DD.

Can you reproduce a case where this is not true?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      10th Apr 2006
=?Utf-8?B?Y29vbHZpZA==?= <(E-Mail Removed)> wrote in
news:7A970EF0-9142-4C3E-B31B-(E-Mail Removed):

> and non-savvy users do not realise that this is the case.


It's not a problem for users: it's a problem for developers. There is
loads of useful information about handling dates in Access on the web.
There is no excuse for letting your users get away with entering dates
wrong.

> To get around this on most (other) database systems one can enter the
> date in the ISO format YYYY-MM-DD, e.g. 2006-03-09 always means the
> 9th March. However in Access and SQL Server this is sometimes,
> seemingly irratically interpreted as the 3rd September.


More information here: I have never seen this, and always found ISO-like
dates to be unambiguously interpreted. In fact it's even robust enough
to treat this:

? cdate("2006-30-04")

as an error. Try that with 30/04/2006 and 04/30/2006.

> Since the behaviour is inconsistent, it is nigh on impossible to write
> code with predictable results causing severe embarrassment with
> clients.


Well, it would be if true. Please supply a method to reproduce this
behaviour.

> Also, occasionally, a time is displayed in a field where a date is
> entered for apparently no good reason.


I am suspecting you have a broken setup. A time is _always_ present, but
(a) if you only enter a date value, it is set to midnight, and (b) if
it's midnight the General format will not display it. You need to (i)
get a grip on your text box format properties, and (ii) get a grip on
how date-time values are entered into your records.

Hope that helps


Tim F
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a report with dates using month not year in access Cristina Microsoft Access Reports 3 5th Mar 2008 03:12 PM
Default date format for dates entered without a year DWalker Microsoft Excel Discussion 2 11th Jan 2008 11:34 PM
Query for current year dates plus December of previous year?? tlyczko Microsoft Access Queries 2 5th Jun 2006 08:49 PM
How to get only the year in the date format in Access =?Utf-8?B?eWFudQ==?= Microsoft Excel New Users 1 10th Jan 2005 03:50 AM
How to make Excel treat the dates AS DATES which are taken from a Web Page ? sorabh Microsoft Excel Misc 5 9th Apr 2004 03:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:34 PM.