Calculating Time Help

F

Floyd Forbes

I have two textboxes with sTime and eTime. If I enter time as decimal how do
I
calculate time.e.g

sTime = 7.00
eTime = 1.00
TotalTime = 6.00

Floyd
 
J

John W. Vinson

I have two textboxes with sTime and eTime. If I enter time as decimal how do
I
calculate time.e.g

sTime = 7.00
eTime = 1.00
TotalTime = 6.00

Floyd

Well... time isn't really decimal. is 1.00 1AM? or 1PM? Is 1.00 later than
11.00 or two hours earlier? Do your times ever span midnight?

If it's decimal numbers... just subtract. 7.00 - 1.00 is in fact 6.00. If
it's actually times of day, consider using a Date/Time field storing the date
and time (so that #11/20/2007 1:00:00# is actually two hours after #11/19/2007
23:00:00#) and using DateDiff() to calculate the time between.

John W. Vinson [MVP]
 

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