By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,400 Members | 981 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,400 IT Pros & Developers. It's quick & easy.

Problem in a report?

P: n/a
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?
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.