THuG has asked for the wisdom of the Perl Monks concerning the following question:

The magic of Perl has failed me, but I was comforted to learn that it was there.

I have a PerlScript ASP that is querying an MS Access DB. One of the fields is a date field, and it seems the PerlScript can't make any sense out of the data. Is there an incantation I can use to release the date?

I was comforted to know that Perl is doing magic to release the other data types. If I ask it to add or write $RS->Fields(0)->{Value} then it does so, since that field is a long integer. But if I ask it to write $RS->Fields(9)->{Value} it writes out the memory address of the scalar pointer. That field is supposed to be a date, represented in the DB in m/d/yyyy format.

I figure that date data is not represented as a string, but as some proprietary data, and as such, Perl can't understand it, or assumes it is another pointer, so it shows it to me. I explicitly dereference it and ask it to write ${$RS->Fields(9)->{Value}}. When I do that it writes a long string or numbers much like "155963932".

What is that? Is it epoch seconds? I haven't a clue.

-Travis

Replies are listed 'Best First'.
Re: MS Access DB Date Field
by MZSanford (Curate) on Jul 19, 2001 at 18:10 UTC
    From the module Spreadsheet::ParseExcel I recall Window uses seconds since 1904 ... i would test the number to see if that is you cause. Specific readme this was in is here.
    OH, a sarcasm detector, that’s really useful
      Well, if it is epoch, it was less than five years ago (unless I did my math wrong).

        Well, when you dereference the date field it looks like you are getting a date/time, though not in an immediatly recognizable format. I know that excel stores it's date in some strange format, have you looked into how access stores dates?

        There's got to be an excel module on cpan that will work with dates. Maybe the date manipulation provided there will work with your access date problem.

Re: MS Access DB Date Field
by aquacade (Scribe) on Jul 19, 2001 at 21:43 UTC

    Check out this link! Hope it helps you!

    http://support.microsoft.com/support/kb/articles/Q209/9/22.asp

    aquacade