Working with Time Format

mcadle

Registered User.
Local time
Today, 06:08
Joined
Jul 16, 2004
Messages
84
I posted this in general a time ago and the issue did not get resolved. Here is the info:

I have a multiple fields where the mechanics input their labor amount. They enter this in standard time format. I need to be able to add this time up and give a total of labor. I made the field in the table date/time and the format short time. The same has been done to the text box on the form. This works except when the labor exceeds 24 hours. Access is assuming that the time entered is an actual time of the day and not what it actually is.

If you need any more info. I will post it ASAP. Thanks for all of the help.
 
Nevermind, just spent some time and figured it out.

=Format(([text41]+[text42]+[text43]+[text44])*24,"#.0" & " Hours")

Now that is good naming convention. :D

Also this procedure works as well.

Function DaysHoursMinutes (Interval)
Dim Days As Long, Remainder As Double
Days = CLng(Interval)
Remainder = Interval - Days
DaysHoursMinutes = Days & IIf(Days = 1, " Day ", " Days ") & Format(Remainder, "h:mm") & " Hours"
End Function
 

Users who are viewing this thread

Back
Top Bottom