Convert Time to Decimal

V

V Terry

I'm trying to convert 02:15:00 or 15:00 into a decimal,
such as 2.25 or 0.25 any ideas?

Unfortunately the data is as above, not consistent in the
number of places, not always hours and minutes, just
minutes if less than an hour.

Thank you!
 
F

fredg

I'm trying to convert 02:15:00 or 15:00 into a decimal,
such as 2.25 or 0.25 any ideas?

Unfortunately the data is as above, not consistent in the
number of places, not always hours and minutes, just
minutes if less than an hour.

Thank you!

DecimalTime:DatePart("h",[TimeField]) &
Format(DatePart("n",[TimeField])/60,".00")
 
G

Guest

Works like a charm! I do have a problem if the original
time is over 24 hours, is there a variation for that
situation?

Thanks so much for passing on your knowledge!

Vickie Terry
-----Original Message-----
I'm trying to convert 02:15:00 or 15:00 into a decimal,
such as 2.25 or 0.25 any ideas?

Unfortunately the data is as above, not consistent in the
number of places, not always hours and minutes, just
minutes if less than an hour.

Thank you!

DecimalTime:DatePart("h",[TimeField]) &
Format(DatePart("n",[TimeField])/60,".00")
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 

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

Top