Re: Date problem
From: Douglas J. Steele (NOSPAM_djsteele_at_NOSPAM_canada.com)
Date: 10/03/04
- Previous message: Stephen Bowyer: "Date problem"
- In reply to: Stephen Bowyer: "Date problem"
- Next in thread: Chris Barber: "Re: Date problem"
- Reply: Chris Barber: "Re: Date problem"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 3 Oct 2004 07:47:25 -0400
A correction first. Your dates are NOT being "stored in UK dd/mm/yyyy
style.". Dates are stored as 8 byte floating point values, where the integer
part represents the number of days relative to 30 Dec, 1899, and the decimal
part represents the time as a fraction of a day. They can be formatted
however you like for presentation, and that's the only place where
dd/mm/yyyy enters into it.
If you're using SQL statements to insert the dates into your tables, the
dates MUST be in mm/dd/yyyy format, regardless of what your Short Date
format has been set to. (Okay, this isn't strictly true: you can use any
unambiguous format, such as dd mmm yyyy or yyyy-mm-dd. The point is, dates
in dd/mm/yyyy format are going to be interpretted as being in mm/dd/yyyy
format unless dd is 13 or higher. And if you're only using a 2 digit year,
there's even more chance of error.)
While they're aimed at Access programmers, you still might find it useful to
read Allen Browne's "International Dates in Access" at
http://members.iinet.net.au/~allenbrowne/ser-36.html or what I have at
http://members.rogers.com/douglas.j.steele/SmartAccess.html
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Stephen Bowyer" <stephen.bowyer@nospamdsl.pipex.com> wrote in message news:415fc6ce$0$29944$cc9e4d1f@news.dial.pipex.com... > VB5 front end for an Access 97 database. > The app displays a date from one table on a form, which can be modified by > the user. The date is then entered in a new or modified record in another > table. However in the second table the year is being stored as '2020' > instead of 2004. This only happens with a few records, not all. > I guess the fact that 2004 is always converted to 2020 should give me a clue > as to what is causing this bug, but I can't see it. > Dates are stored in UK dd/mm/yyyy style. > Any help appreciated. > > Steve. > >
- Previous message: Stephen Bowyer: "Date problem"
- In reply to: Stephen Bowyer: "Date problem"
- Next in thread: Chris Barber: "Re: Date problem"
- Reply: Chris Barber: "Re: Date problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|