I'm trying to add a YEAR parameter to the following working query:
I created a union query for the program years and I'm trying to use it here so it will display only the months for the inputed year. But when I run it, I don't get any data. Any idea what's wrong?
What the query does - is it figures out what nonmembers have participated in any program, ordered by month (trying to get a YEAR parameter to work).
Thanks for any help!!
Code:
TRANSFORM Count(qryNONMembers.PID) AS CountOfPID
SELECT [qryUnionProgramMonths].M, qryNONMembers.Mtype, Count(qryNONMembers.PID) AS TotalNONMemberParticipants
FROM qryNONMembers LEFT JOIN qryUnionProgramMonths ON qryNONMembers.PID=[qryUnionProgramMonths].pid
GROUP BY [qryUnionProgramMonths].M, qryNONMembers.Mtype
ORDER BY [qryUnionProgramMonths].M
PIVOT qryNONMembers.LocW;
I created a union query for the program years and I'm trying to use it here so it will display only the months for the inputed year. But when I run it, I don't get any data. Any idea what's wrong?
Code:
PARAMETERS [Year] Text ( 255 );
TRANSFORM Count(qryNONMembers.PID) AS CountOfPID
SELECT qryUnionProgramMonths.M, qryNONMembers.Mtype, Count(qryNONMembers.PID) AS TotalNONMemberParticipants
FROM (qryNONMembers LEFT JOIN qryUnionProgramMonths ON qryNONMembers.PID = qryUnionProgramMonths.pid) INNER JOIN qryUnionProgramYearsTRY ON qryNONMembers.PID = qryUnionProgramYearsTRY.pid
WHERE (((Year([qryUnionProgramYearsTRY.YR]))=[Year]))
GROUP BY qryUnionProgramMonths.M, qryNONMembers.Mtype
ORDER BY qryUnionProgramMonths.M
PIVOT qryNONMembers.LocW;
What the query does - is it figures out what nonmembers have participated in any program, ordered by month (trying to get a YEAR parameter to work).
Thanks for any help!!