Tiime

RevJeff

Registered User.
Local time
Today, 14:52
Joined
Sep 18, 2002
Messages
129
How can I take one time field and subtrack it from another and come up with the time difference?

Ex:
03:00 pm - 02:00 pm ="1 hour" or "01:00"

Both are medium time fields. Is this possible?

Thanks,
Jeff
 
If you are only entering the Time values .. you will have a problem when the end tim spans into another day.

But if the elapsed time will never span more than 24 hours .. go to the link befow for information and a work around.

StartTime-EndTime Results in a Negative Number

HTH
RDH
 
Time

This works but if you require more than 24 hours as shown in the previous suggestion, you must put the date(s) in this. Also following the example is the link to MS Knowledge Base which can also help you in setting this up.

StartDate = #6/1/1993 3:30:00 AM#
EndDate = #6/2/1993 1:25:00 AM#
'StartDate = #3:30:00 AM#
'EndDate = #1:25:00 PM#
Debug.Print Format(EndDate - StartDate, "hh:mm")

http://support.microsoft.com/default.aspx?scid=kb;EN-US;210604
 

Users who are viewing this thread

Back
Top Bottom