SteveL13
asked on
Crosstab query question
I have created a crosstab query which work fine and displays all records. But in the query designer I want to set a criteria using a year number (like 2013) which I'm getting from a form combobox.
Here is the query criteria:
[Forms]![frmSelectYearForM onthlySumR eports]![c boYear]
But it doesn't work because that field on the query is:
Format([DateWorked],"mmm")
What do I have to change in the criteria line?
--Steve
Here is the query criteria:
[Forms]![frmSelectYearForM
But it doesn't work because that field on the query is:
Format([DateWorked],"mmm")
What do I have to change in the criteria line?
--Steve
ASKER
There is no where clause to add this to. Here is the SQL:
TRANSFORM Sum(qryMonthlySumReportPub licHrs.Tot PublicHour s) AS SumOfTotPublicHours
SELECT qryMonthlySumReportPublicH rs.DocentI D, qryMonthlySumReportPublicH rs.LastNam e, qryMonthlySumReportPublicH rs.FirstNa me, tblDocents.AssignedDay, Sum(qryMonthlySumReportPub licHrs.Tot PublicHour s) AS [Total Of TotPublicHours]
FROM qryMonthlySumReportPublicH rs LEFT JOIN tblDocents ON qryMonthlySumReportPublicH rs.DocentI D = tblDocents.DocentID
GROUP BY qryMonthlySumReportPublicH rs.DocentI D, qryMonthlySumReportPublicH rs.LastNam e, qryMonthlySumReportPublicH rs.FirstNa me, tblDocents.AssignedDay
PIVOT Format([DateWorked],"mmm") In ("Jan","Feb","Mar","Apr"," May","Jun" ,"Jul","Au g","Sep"," Oct","Nov" ,"Dec");
TRANSFORM Sum(qryMonthlySumReportPub
SELECT qryMonthlySumReportPublicH
FROM qryMonthlySumReportPublicH
GROUP BY qryMonthlySumReportPublicH
PIVOT Format([DateWorked],"mmm")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Where ....
AND [Forms]![frmSelectYearForM
There is no need to add the additional column to the select clause.