I don't think I can do that. The formula for DutyTime is a module, and looks
like this:
Function GetElapsedTime(interval)
Dim LngHours As Long, LngMinutes As Long
If IsNull(interval) Then
GetElapsedTime = 0
Else
interval = interval + 0.000006
LngHours = Int(interval * 24)
LngMinutes = Int(interval * 1440) Mod 60
GetElapsedTime = LngHours & " Hrs. " & LngMinutes & " Min. "
End If
End Function
This calculates DutyTime even if the DutyOut is a clander day later than
DutyIn
ie.
DutyIn 01/01/07 2100 DutyOut 01/02/07 0600 DutyTime= 9:0 hrs
Is my basic time calculation module more complex than it needs to be?
If the Control Source of the Text Box in the Report is
=GetElapsedTime([FieldName])
Then in the Sum field you can use
=Sum(GetElapsedTime([FieldName]))
Or, another option.
Create another text box in the report, identical to the text box that
display the time different.
Set two of it's prperties:
Visible = No
RunningSum = Yes
In the report footer you can refer to that text box
=[NewTextBoxName]

Signature
Good Luck
BS"D
> I don't think I can do that. The formula for DutyTime is a module, and looks
> like this:
[quoted text clipped - 38 lines]
> > > I've tried =Sum([DutyTime]),
> > > but I get a "expression is too complex..." help??
AttackIP - 30 Apr 2007 03:42 GMT
OK, got it! Now one more issue. The DutyTime is displayed as a short time
ie. 6:45 for 6hrs 45mins worked. If the sum of DutyTime is greater than
24hrs (say 34hrs 15 mins), it is displayed as 10:15 (which would be 34:15-24
since short time can only display time as 00:00). How can I force it to
show 34:15 ? Or 134:15 for that matter, if that's the total number of hours
worked...
> If the Control Source of the Text Box in the Report is
> =GetElapsedTime([FieldName])
[quoted text clipped - 54 lines]
> > > > I've tried =Sum([DutyTime]),
> > > > but I get a "expression is too complex..." help??
Ofer Cohen - 30 Apr 2007 10:26 GMT
Well, the time can be more then 24 hrs usually if you move between dates.
If you add a date to that field it will calculate the different as it
should, other wise how ca you tell if
Start 11:00 AM
Finish 2:00 PM
it's 25 hrs and not 3?

Signature
Good Luck
BS"D
> OK, got it! Now one more issue. The DutyTime is displayed as a short time
> ie. 6:45 for 6hrs 45mins worked. If the sum of DutyTime is greater than
[quoted text clipped - 61 lines]
> > > > > I've tried =Sum([DutyTime]),
> > > > > but I get a "expression is too complex..." help??
Ofer Cohen - 30 Apr 2007 11:34 GMT
Sorry,
27 hrs and not 3

Signature
Good Luck
BS"D
> Well, the time can be more then 24 hrs usually if you move between dates.
>
[quoted text clipped - 71 lines]
> > > > > > I've tried =Sum([DutyTime]),
> > > > > > but I get a "expression is too complex..." help??