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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some help with format issue 2

Status
Not open for further replies.

tamer64

IS-IT--Management
Aug 27, 2007
120
US
I have a form where the user enters hours and minutes. In my query I have the following which takes the values entered into the hours and minutes and sums them.

QUERY 1:
[blue]TotalSumHours: [SumOfHours]+Int([SumOfMinutes]/60) & ":" & [SumOfMinutes] Mod 60 [/blue]

When values are entered into the Hours/minutes field as 8 and 12 the values are displayed as 8:12, but if I were to enter 8 and 00, the leading zero would drop off. To fix this issue I added created another query based of a table from the results of the first query above:

QUERY 2:
[blue]TotalSumHours: Left([T_107_Step6_Groups_All_UPT_Times_By_Employee]![TotalSumUHours] & "0",4)[/blue]

This then added the leading zero to 8:00. The problem I am now having is for example if the TotalSumHours is 12:04 the value is displaying as 12:4

Is there a way to format either query 1 or 2 to display the correct format without loosing zeros?
 
TotalSumHours: [SumOfHours]+Int([SumOfMinutes]/60) & ":" & [!]Format([/!][SumOfMinutes] Mod 60[!], "00")[/!]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top