Integer to Time Conversion

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

Gary Paris

I have an Int field in an access table (Long Int) that stores time in
seconds but stores it like this:
It seems that it adds a '01' to the end of the field.

3960001 (Which is 11:00 AM )
4680001 (Which is 3:30 PM)
3240001 (Which is 9:00 AM)

How can I convert these integer numbers to the proper time?

Thanks,

Gary
 
Gary said:
I have an Int field in an access table (Long Int) that stores time in
seconds but stores it like this:
It seems that it adds a '01' to the end of the field.

3960001 (Which is 11:00 AM )
4680001 (Which is 3:30 PM)
3240001 (Which is 9:00 AM)

How can I convert these integer numbers to the proper time?

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

int(3960001/1000)/360 will yield 11
int(4680001/1000)/360.0 will yield 13 (1pm)
int(3240001/1000)/360 will yield 9

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

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

iQA/AwUBQnBPLYechKqOuFEgEQKSywCfZE+bA7MDXLSrv0wE53DobOjN/kIAoMZf
MMp2DofijIRqqQYC8J6o6mld
=p31A
-----END PGP SIGNATURE-----
 
Try:

TimeSerial([YF] \ 360000, ([YF] \ 60000) MOD 60, ([YF] \ 100) MOD 60)

[YF]: YourField

There are 3 expressions corresponding to the 3 arguments for TimeSerial.
The first expression should give the integral hours, second expression
integral minutes ( < 60) and last expression the remaining seconds ( < 60).

HTH
Van T. Dinh
MVP (Access)
 
Sorry, typing error. The second expression should be:

([YF] \ 6000) MOD 60

i.e. integer division by 6,000, not 60,000.

HTH
Van T. Dinh
MVP (Access)



Van T. Dinh said:
Try:

TimeSerial([YF] \ 360000, ([YF] \ 60000) MOD 60, ([YF] \ 100) MOD 60)

[YF]: YourField

There are 3 expressions corresponding to the 3 arguments for TimeSerial.
The first expression should give the integral hours, second expression
integral minutes ( < 60) and last expression the remaining seconds ( < 60).

HTH
Van T. Dinh
MVP (Access)


Gary Paris said:
I have an Int field in an access table (Long Int) that stores time in
seconds but stores it like this:
It seems that it adds a '01' to the end of the field.

3960001 (Which is 11:00 AM )
4680001 (Which is 3:30 PM)
3240001 (Which is 9:00 AM)

How can I convert these integer numbers to the proper time?

Thanks,

Gary
 

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