christian wrote:
HI all,
I've several fields in a report which datatype is Date/Time.
Day WorkedHours
Monday 8:00
Tuesday 8:00
Wednesday 8:00
Thursday 7:00
Friday 8:30
Saturday 5:30
The Problem is that I want to add the Total Workedhours per week in a
report. I used this expression in the COntrol Source=
sum([Workedhours]), but it doesn't work. I was told that maybe because
my fields were Date/time won't add up. Does anybody have any
suggestions?
Well, you could create an IIF string in your recordsource
WH : Hour([DateField]) + IIF(Minute([DateField]) = 30,.50,0)
This would convert 8.30 to 8.5. So you could have a column in your
report query, put this column in the report and set the visible
problerty to false, and sum it up. However, the value would be in
decimal, not hh:mm.
Otherwise, break out the hour and minutes;
WorkHours = Hour([DateField])
WorkMinutes = Minute([DateField])
and sum them up n the footer. Then you need to divide tot minutes by 60
to get the number of hours and mod the minutes by 60 to get the
remainder of minutes.
Or something on that order.