I have a query that uses a DMIN function to find the first time a company (org) registered and to capture that date. A subsequent query groups and counts all the data by months and displays the total. I have a report based on this and another similar query which finds the number of students.
How do I add a parameter to the query that will allow someone to select 2010 results vs 2011 and so on?
My two queries are based on a table, but I tried creating a simple query with all the fields of the table and using the parameter option in the query criteria. That didn't work. I understand it may be related to the DMIN function. Some of the tips I am seeing online point to creating a form for date input and linking the report to the form, but I am not sure how to go about this.
Alternately, and I might prefer this solution if it is easier for a novice, I wouldn't be opposed to hard coding the query/report to only show 2011 data. I would then create one for 2010 and one for 2011.
Here is the code for the first query
SELECT DISTINCT [tblCombined_Enrollment].studentorg, tblCombined_Enrollment.[EnrollDate]
FROM tblCombined_Enrollment
WHERE (((tblCombined_Enrollment.[EnrollDate])=DMin("EnrollDate","tblCombined_Enrollment","[studentorg] = '" & [studentorg] & "'"));
and the second:
SELECT Format([EnrollDate],"mm yyyy",0,0) AS [Month Period], Count([Firms Serviced].StudentOrg) AS [Firms Serviced]
FROM qryUniqueOrgCombined AS [Firms Serviced]
GROUP BY Format([EnrollDate],"mm yyyy",0,0)
HAVING (((Format([EnrollDate],"mm yyyy",0,0))<>False))
ORDER BY Format([EnrollDate],"mm yyyy",0,0);
Thank you so much for your help.
Vicky