cfriedberg
MIS
I want to have the report headings be added dynamically. It is for a report for labor. The cycle can begin on any day of the week and can be for multiple weeks. This report is a sub report and the data I am using is from SQL 2000.
This is a portion of the code to get the daily totals. The code is modified to have the appropriate beginning weekday for the totals. Currently I am using another sub report on top of this to have the column headings print. It would be nice to have it all in one.
Sum(Case DateName(Weekday,BDate) When 'Monday' Then BQUAN Else 0 End) as [Monday],
.
.
.
Sum(Case DateName(Weekday,BDate) When 'Sunday' Then BQUAN Else 0 End) as Sunday,
Sum(Case DATEPART(week, BDATE) When @WeekNo Then BQUAN Else 0 End) as Items, BPRICE,
Sum(Case DATEPART(week, BDATE) When @WeekNo Then BQUAN Else 0 End) * BPRICE as [Ext. Price]
This is a portion of the code to get the daily totals. The code is modified to have the appropriate beginning weekday for the totals. Currently I am using another sub report on top of this to have the column headings print. It would be nice to have it all in one.
Sum(Case DateName(Weekday,BDate) When 'Monday' Then BQUAN Else 0 End) as [Monday],
.
.
.
Sum(Case DateName(Weekday,BDate) When 'Sunday' Then BQUAN Else 0 End) as Sunday,
Sum(Case DATEPART(week, BDATE) When @WeekNo Then BQUAN Else 0 End) as Items, BPRICE,
Sum(Case DATEPART(week, BDATE) When @WeekNo Then BQUAN Else 0 End) * BPRICE as [Ext. Price]