I want to be able to enter a Start Date and End Date in a form for a report based on this query (I know how to make the form, just can't figure out the code in the query).
Currently the query has a YEAR parameter and then shows the data by month of that year.
How do I change the query below to be able to show data for one or more months based on a Start & End Date?
qryUnionProgramDates.MN is the MONTH
qryUnionProgramDates.YR is the YEAR
The Union query that it refers to looks like this:
Thanks for any help!
Currently the query has a YEAR parameter and then shows the data by month of that year.
How do I change the query below to be able to show data for one or more months based on a Start & End Date?
qryUnionProgramDates.MN is the MONTH
qryUnionProgramDates.YR is the YEAR
Code:
PARAMETERS [Year] Long;
TRANSFORM Count(qryNONMembers.PID) AS CountOfPID
SELECT qryUnionProgramDates.MN, qryUnionProgramDates.YR, qryNONMembers.Mtype, Count(qryNONMembers.PID) AS TotalNONMemberParticipants
FROM qryNONMembers LEFT JOIN qryUnionProgramDates ON qryNONMembers.PID =
qryUnionProgramDates.pid
WHERE (((qryUnionProgramDates.YR)=[Year]))
GROUP BY qryUnionProgramDates.MN, qryUnionProgramDates.YR, qryNONMembers.Mtype
ORDER BY qryUnionProgramDates.MN, qryUnionProgramDates.YR
PIVOT qryNONMembers.LocW;
The Union query that it refers to looks like this:
Code:
SELECT pid, Month (AssessD) as MN, Year(AssessD) as YR from tblFCAssess
union
Select pid, Month(GaspD) as MN, Year(GaspD) as YR from tblGASP
union
Select pid, Month(LnlD) as MN, Year(LnlD) as YR from tblLNL
union
Select pid, Month(MDGSD) as MN, Year(MDGSD) as YR from tblMDG
union
Select pid, Month(NLD) as MN, Year(NLD) as YR from tblNL
union
select pid, Month(PedSD) as MN, Year(PedSD) as YR from tblPed
union
select pid, Month(ScrD) as MN, Year(ScrD) as YR from tblScr
union
select pid, Month(TobCesD) as MN, Year(TobCesD) as YR from tblTobCes
union
select pid, Month(WalkD) as MN, Year(WalkD) as YR from tblWalk
union
select pid, Month(WBD) as MN, Year(WBD) as YR from tblWB
UNION Select pid, Month(ConsD) as MN, Year(ConsD) as YR from tblConsult;
Thanks for any help!