Integer to Date Conversion

  • Thread starter Thread starter Gary Paris
  • Start date Start date
G

Gary Paris

I have a field in a table defined as a Long Integer that holds a number
equated to a date. For instance, the value 74630 would be today.

How could I convert the field to a date like 04-27-2005?

Thanks,

Gary
 
Gary said:
I have a field in a table defined as a Long Integer that holds a number
equated to a date. For instance, the value 74630 would be today.

How could I convert the field to a date like 04-27-2005?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

cdate(74630)

I get 4/29/2104 for that number. Obviously, you have a different start
date than Access uses (December 30, 1899).

April 27, 2005 has the number 38469. It appears your date is 36161 days
before of the Access date (December 28, 1800?). Therefore, to get the
correct Access date you'd use this:

cdate(74630 - 36161)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQnAdMYechKqOuFEgEQIJxwCgrxffp0dcGwZiad0BZLvflOI9HxkAoPoJ
rWiFbkHJ2Iu79PTQj4xZ4Qoy
=7e8q
-----END PGP SIGNATURE-----
 
Thanks. Works like a charm!

Gary

MGFoster said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

cdate(74630)

I get 4/29/2104 for that number. Obviously, you have a different start
date than Access uses (December 30, 1899).

April 27, 2005 has the number 38469. It appears your date is 36161 days
before of the Access date (December 28, 1800?). Therefore, to get the
correct Access date you'd use this:

cdate(74630 - 36161)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQnAdMYechKqOuFEgEQIJxwCgrxffp0dcGwZiad0BZLvflOI9HxkAoPoJ
rWiFbkHJ2Iu79PTQj4xZ4Qoy
=7e8q
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top