424,647 Members | 1,444 Online
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

# Over 80 hours.

 P: n/a This is references to the post # 11 of the following thread.. Click link to view entire thread: http://groups.google.com/group/comp....rum2001&hl=en& ----------------------------------------------------------------------------------------------- Is there anyway to make it like the following. If there is overtime, then have Regular Time display = 80:00:00 If under 80:00:00, then display the correct hours I could not get the original messages back via my ISP Google. Anyway, It's just a matter of building up the calculations and nesting them in IIF statements. so if you have TotalTime (in seconds) RegularTime is iif(TotalTime 80*60*60,80*60*60,Totaltime). OverTime is iif(TotalTime 80*60*60,totaltime-80*60*60,0). Those would go inside the SecToDur() function that I originally provided in 2004 Public Function sec2dur(seconds As Long) As String On Error Resume Next Dim hrs As Long Dim mins As Integer Dim secs As Integer hrs = Int(seconds / 3600) mins = Int((seconds - (3600 * hrs)) / 60) secs = seconds - (hrs * 3600 + mins * 60) sec2dur = Format(hrs, "#,##0") & ":" & Format(mins, "00") & ":" & Format(secs, "00") End Function - Hide quoted text - - Show quoted text - ------------------------------------------------------------------------------------------------------------------------ Where exactly would I put the following lines in the sec2dur? iif(TotalTime 80*60*60,80*60*60,Totaltime). OverTime is iif(TotalTime 80*60*60,totaltime-80*60*60,0). I keep getting coding errors when I paste them. Thanks! Jul 11 '06 #1