O.K., I've got two tables, seminars and enrollments. I've got a dynamic select list, populated by a simple query on the seminars table:
<CFQUERY DATASOURCE="Seminars" NAME="dates_1">
SELECT seminar_id, session_number, seminar_date, seminar_time, seminar_site
FROM seminars
WHERE session_number = 1
ORDER BY session_number, seminar_date, seminar_site
</CFQUERY>
This is used for students to choose from seminars. Max class size is 13, so i dont want a class to appear in the list if it already has 13 participants.
I made a query to give me number of occurences of a seminar ID in the enrollment table:
<CFQUERY DATASOURCE="Seminars" NAME="seminar_full">
SELECT Seminars.seminar_id, Count(Enrollments.Seminar) AS occurences
FROM Seminars INNER JOIN Enrollments ON Seminars.seminar_id = Enrollments.Seminar
GROUP BY Seminars.seminar_id
</CFQUERY>
Now for the problem... How do I write the cfselect to only show me the seminars I want (those with less than 13 participants??
Thanks. --Steve
<CFQUERY DATASOURCE="Seminars" NAME="dates_1">
SELECT seminar_id, session_number, seminar_date, seminar_time, seminar_site
FROM seminars
WHERE session_number = 1
ORDER BY session_number, seminar_date, seminar_site
</CFQUERY>
This is used for students to choose from seminars. Max class size is 13, so i dont want a class to appear in the list if it already has 13 participants.
I made a query to give me number of occurences of a seminar ID in the enrollment table:
<CFQUERY DATASOURCE="Seminars" NAME="seminar_full">
SELECT Seminars.seminar_id, Count(Enrollments.Seminar) AS occurences
FROM Seminars INNER JOIN Enrollments ON Seminars.seminar_id = Enrollments.Seminar
GROUP BY Seminars.seminar_id
</CFQUERY>
Now for the problem... How do I write the cfselect to only show me the seminars I want (those with less than 13 participants??
Thanks. --Steve