Military Time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I change the time from millitary time (0900) to 9 or (0925) to 9.25.
Each one of these are in one feild.
 
Hi, Max

If 09:15 was in C1, the formula in D1 would read =C1*24. But -- the answer
would not be 9.15, it would be 9.25 (15 minutes = 1/4 hour = .25 (1/4 of 100).

You'll notice that I entered the colon between 09 and 15. I think you would
have to format the military time to [hh]:mm (Format Cell Custom) in order for
this to work.

HTH,

Carole O
 
Max said:
How can I change the time from millitary time (0900) to 9 or (0925)
to 9.25. Each one of these are in one feild.

What is the filed type to begin with? Text, number (what kind) etc.
 
Divide the value into hours and minutes, and use the TimeSerial function to
convert these values to a time
t = TimeSerial( Int( v / 100 ), v - 100 * ( Int( v / 100 ) ), 0 )
 
t = TimeSerial( Int( v / 100 ), v - 100 * ( Int( v / 100 ) ), 0 )

Where where I put this in my query or in the report.
 
If you aren't actually going to use it as a variable (for instance, for
doing some sort of comparison) then it's simplest just to insert it into the
report.
 

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