ineedahelp
Technical User
Hello, I have created a crosstab query to summarize my data by month across RESOURCETYPE. The final column in my report needs to display sum for each RESOURCETYPE. I need to sum over the group and then over the whole report. I think my trouble lies in my YTDTOTAL. My main trouble is that my report sums over group for the first group but not the next group. any thoughts? Thanks. Here is the code for my crosstab query:
TRANSFORM Sum(IIf([hoursworked]<>0,([TaskPerformed]![HoursWorked]*[ProjectMember]![Rate]),[TaskPerformed]![FeeAmount])) AS TotFee
SELECT ProjectMember.VendorName, IIf([ResourceType]="External","Vendors","Internal") AS GroupHead, TaskPerformed.Action, Sum(IIf([hoursworked]<>0,([TaskPerformed]![HoursWorked]*[ProjectMember]![Rate]),[TaskPerformed]![FeeAmount])) AS YTDTotal
FROM ProjectMember LEFT JOIN TaskPerformed ON ProjectMember.MemberID = TaskPerformed.MemberID
WHERE (((TaskPerformed.DatePerformed) Between #1/1/2009# And #12/31/2009#))
GROUP BY ProjectMember.VendorName, IIf([ResourceType]="External","Vendors","Internal"), TaskPerformed.Action
PIVOT Format([DatePerformed],"mm-yyyy");
I have put in my report... =sum(ytdTotal) as the last column in my detail section and also in the group section. I sorry but didn't know how to show you my report.
TRANSFORM Sum(IIf([hoursworked]<>0,([TaskPerformed]![HoursWorked]*[ProjectMember]![Rate]),[TaskPerformed]![FeeAmount])) AS TotFee
SELECT ProjectMember.VendorName, IIf([ResourceType]="External","Vendors","Internal") AS GroupHead, TaskPerformed.Action, Sum(IIf([hoursworked]<>0,([TaskPerformed]![HoursWorked]*[ProjectMember]![Rate]),[TaskPerformed]![FeeAmount])) AS YTDTotal
FROM ProjectMember LEFT JOIN TaskPerformed ON ProjectMember.MemberID = TaskPerformed.MemberID
WHERE (((TaskPerformed.DatePerformed) Between #1/1/2009# And #12/31/2009#))
GROUP BY ProjectMember.VendorName, IIf([ResourceType]="External","Vendors","Internal"), TaskPerformed.Action
PIVOT Format([DatePerformed],"mm-yyyy");
I have put in my report... =sum(ytdTotal) as the last column in my detail section and also in the group section. I sorry but didn't know how to show you my report.