Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time to number 1

Status
Not open for further replies.

Ptrif

Technical User
May 19, 2003
106
US
Is it possible to convert an entered time such as 10:30 <--that time meaning 10 hours and 30 mintutes, to 10.5?? any help is apprciated.
 
Hi,

Yes. Use the following formula to calculate the output:

TheHour = Hour (TimeField)
TheMinute = Minute (TimeField) / 60
Output = str(TheHour) & &quot;.&quot; & str(TheMinute)

John
 
I think you can use this also
TimeField * 24
10:30 return 10.5


Paul
 
Paul is correct (and gets a star). There is no need to convert time since it is stored in a floating point numeric value that is equivalent to a number of days and percents of days. Since there are 24 hours in a day, multiply your time value by 24 to get the number of hours.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top