cdavisdccb
Programmer
I have a crosstab query that returns overtime hours for 12 departments during the work week (Mon - Sat).
I also have a report that displays this data. In the report, I have unbound fields to show 12 running sums (Grand Total). What I need is also the Weekly Total.
I've tried several different suggestions that I found in this forum, but can't quite get what I want. the closest formula I used is:
"WeekEnding: [OTDate]-Weekday([OTDate])", but I can't figure it into the report.
I've gotten the query to give me only the current month by using:
"((Month([OTDate]))=Month(Now())" <--SQL
Without listing all 12 departments, the report is as such:
(Date is "Long Date" format, and skipped dates return nothing since it's a crosstab query)
[tt]
OTDate dept1 dept2 dept3 dept4
(Tue)6/1 0.0 1.5 2.5 0.0
(Wed)6/2 0.0 0.0 3.0 2.0
(Thu)6/3 0.5 1.5 1.0 2.0
(Sat)6/5 0.0 8.0 4.0 0.0
0.5 11.0 10.5 4.0 <--*Week 1 Total*
(Mon)6/7 1.0 1.5 0.0 0.0
(Tue)6/8 1.0 1.0 1.0 1.0
(Wed)6/9 0.5 0.0 1.5 2.0
(Thu)6/10 1.0 1.0 2.0 2.5
(Sat)6/12 4.0 4.0 0.0 3.5
7.5 7.5 4.5 9.0 <--*Week 2 Total*
(Mon)6/14 0.5 1.0 0.0 0.0
0.5 1.0 0.0 0.0 <--*Week 3 Total*
8.5 19.5 15.0 13.0 <--*GRAND TOTAL*
[/tt]
The report/query must be able to determine the appropriate Saturday, and if there's no data for a Saturday (as in Week 3 example), then it sums up to the next Saturday.
I hope I explained this well enough.
If anyone has any suggestions, I'd surely appriciate it!
Chris
"It doesn't matter how idiot-proof you make it, someone makes a better idiot!"
I also have a report that displays this data. In the report, I have unbound fields to show 12 running sums (Grand Total). What I need is also the Weekly Total.
I've tried several different suggestions that I found in this forum, but can't quite get what I want. the closest formula I used is:
"WeekEnding: [OTDate]-Weekday([OTDate])", but I can't figure it into the report.
I've gotten the query to give me only the current month by using:
"((Month([OTDate]))=Month(Now())" <--SQL
Without listing all 12 departments, the report is as such:
(Date is "Long Date" format, and skipped dates return nothing since it's a crosstab query)
[tt]
OTDate dept1 dept2 dept3 dept4
(Tue)6/1 0.0 1.5 2.5 0.0
(Wed)6/2 0.0 0.0 3.0 2.0
(Thu)6/3 0.5 1.5 1.0 2.0
(Sat)6/5 0.0 8.0 4.0 0.0
0.5 11.0 10.5 4.0 <--*Week 1 Total*
(Mon)6/7 1.0 1.5 0.0 0.0
(Tue)6/8 1.0 1.0 1.0 1.0
(Wed)6/9 0.5 0.0 1.5 2.0
(Thu)6/10 1.0 1.0 2.0 2.5
(Sat)6/12 4.0 4.0 0.0 3.5
7.5 7.5 4.5 9.0 <--*Week 2 Total*
(Mon)6/14 0.5 1.0 0.0 0.0
0.5 1.0 0.0 0.0 <--*Week 3 Total*
8.5 19.5 15.0 13.0 <--*GRAND TOTAL*
[/tt]
The report/query must be able to determine the appropriate Saturday, and if there's no data for a Saturday (as in Week 3 example), then it sums up to the next Saturday.
I hope I explained this well enough.
If anyone has any suggestions, I'd surely appriciate it!
Chris
"It doesn't matter how idiot-proof you make it, someone makes a better idiot!"