Board index » delphi » MS Access Date value problems

MS Access Date value problems

Hi,
I converted my app's database from Paradox to MS Access. Now all the
date fields display weirdly high in my app. The
FieldByName('MyDate').AsDateTime returns a huge number like 6253647448,
whereas with the old Paradox tables the same expression returned values
in the 63242 range. In a dbEdit, the converted Access date fields
display like 03/09/25384 (very future!). With Paradox, they look like
08/15/1999. BUT (!) - Database Desktop displays correct values for the
converted Access data, same values as it does for the Paradox data. What
would be the difference in my app and Database Desktop for how it
displays date fields in a dbEdit? It seems that the internal
representation for Access is different, and Database Desktop knows that
but my app doesn't. Any ideas are welcome! (I converted the data using
the MS Access import utility. I'm using BDE, direct).
Thanks, Shakya Jones
 

Re:MS Access Date value problems


Can't help much beyond a few words about Microsoft Access' internal storage
of dates.

A date, or a time, or a date WITH time is stored as a number, with the whole
part of the number representing the number of days since (I think) 30
December 1899, and the fractional part of the number the time of day (.25 is
6am, .5 is noon, .75 is 6pm, .9999 is about 11:59:59pm). Negative numbers
mean dates before 30 December 1899.

Maybe the edit control is somehow "skipping over" the decimal point, and a
date of 1.75 (6pm on 31 December 1899) ends up as 175 (23 June 1900)?

Hope this might help at least a little.

Quote
"Shakya Jones" <sha...@mindless.com> wrote in message

news:395A692B.9C2392C1@mindless.com...
Quote
> ... It seems that the internal
> representation for Access is different, and Database Desktop knows that
> but my app doesn't...

Other Threads