ineedahelp
Technical User
I am trying to produce a report using two crosstab queries. Each query works well on its own. When combined I get an error message "syntax error in query expression Format([DatePerformed],"mm-yyyy")
I think I might have too many characters. Any help? Thanks!
Here is my SQL...
I think I might have too many characters. Any help? Thanks!
Here is my SQL...
Code:
TRANSFORM Sum(TaskPerformed.FeeAmount) AS SumOfFeeAmount
SELECT TaskPerformed.Description, ProjectMember.MemberID, Sum(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#) AND ((TaskPerformed.Description)="Software Maintenance")) OR (((TaskPerformed.Description)="Software License"))
GROUP BY TaskPerformed.Description, ProjectMember.MemberID
ORDER BY TaskPerformed.Description
PIVOT Format([DatePerformed],"mm-yyyy")
UNION
TRANSFORM IIf([Description]="Consulting Services",Sum([ProjectMember].[Rate]*[TaskPerformed].[HoursWorked]),Sum([FeeAmount])) AS TotalFee
SELECT [LastName] & ", " & [FirstName] AS FullName, TaskPerformed.Description, ProjectMember.MemberID, Sum([TotalFee]) AS YTDTotal
FROM ProjectMember LEFT JOIN TaskPerformed ON ProjectMember.MemberID = TaskPerformed.MemberID
WHERE (((TaskPerformed.Description) In ("Travel Expense","Consulting Services")) AND ((TaskPerformed.DatePerformed) Between #1/1/2009# And #12/31/2009#))
GROUP BY [LastName] & ", " & [FirstName], TaskPerformed.Description, ProjectMember.MemberID
ORDER BY [LastName] & ", " & [FirstName], TaskPerformed.Description
PIVOT Format([DatePerformed],"mm-yyyy");