|
|
Hi --
I have a situation in which I need to make registration available for a series
of programs, but only until there are 16 registrants in a program; once 16
registrants have signed up for a program, that program is no longer available.
I want to show only the available programs, grouped by program category (there
are two categories). I also want to show a message ("Sorry, this program is
full") when the number of registrants has been reached.
I have a recordset that finds only the available programs, but I do not know
how to group them by category, or how to show the "Sorry" message. Any help
would be appreciated. Follows are the abbreviated table structures in question
and the recordset I currently have in place that shows all the programs with
fewer than 16 registrants:
Table1: LocationPrograms
ProgLocID - primary key
LocCat - Location Category
LocNme - Location Name
Table 2: Registrants
ID - primary key
ProgLocID_FK - Foriegn key referencing the primary key in TBL LocationPrograms
Name - Name of registrant
ProgramALL - Name of the Program the Registrant signed up for
SELECT LocNme
FROM LocationPrograms
LEFT OUTER JOIN Registrants
ON LocationPrograms.LocNme = Registrants.ProgramALL
GROUP BY LocationPrograms.LocNme
HAVING COUNT(LocationPrograms.LocNme) < 16
|
|