# Thread: Convert hh:mm:ss to Number

1. Registered User
Join Date
May 2013
Posts
40

## Unanswered: Convert hh:mm:ss to Number

Good morning,

I'm trying to figure out if it is possible either in a query or report to convert time to a decimal number.

Example:
112:09:51 converted to 112.09

any and all help is greatly appreciated.

2. Registered User
Join Date
May 2013
Posts
40
I ask because in the report that I'm working on I'll need to show Run Rate per hour which consist of Exit volume / Time

Exit Volume / Time as Number = Run Rate
646,280 / 112.09 = 5,765.72

Thanks,

Join Date
Nov 2004
Location
out on a limb
Posts
13,692
=hours(mytimevalue) + minutes(mytimevalue)/100
but surely you want it as a 'true decimal' (ie proportion of an hour)
=hours(mytimevalue) + minutes(mytimevalue)/60 + seconds(mytimevalue)/3600

another slightly kludgy way of achieving this is to take advantage of the way Accewss (using JET, its default storage medium) is convert the date time value directly into the proportion of hours. this assumes, as above, that you are using a sdatetime column/variable

= dbl(mytimevalue)*24

FWIW JET soters datetimes as a double value number.
the integer part contains the number fo days form an arbitary point in time (day 1 is, IIRC, 31 Dec 1899), the decimal is the proportion of the day

eg
.50 is 12:00:00
.75 is 18:00:00
0.00069444444 is one second (or 1/60/24)
Last edited by healdem; 05-23-14 at 13:10.

4. Registered User
Join Date
May 2013
Posts
40
Thanks Healdem,

So do this go in the Query or Report? Is this the correct way to input it?
=([TotalTime]+[TotalTime]/60+[TotalTime]/3600)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•