psycoperl
Active Member
- Joined
- Oct 23, 2007
- Messages
- 339
- Office Version
- 365
- 2016
- Platform
- Windows
- MacOS
- Web
I am working on trying to write a query that will give me available sessions that have seats remaining, and cannot figure out how to write one that will give me everything I need. Any help and guidance would be most helpful
Need to obtain:
ts.tsTestSessionID, ts.tsTestSessionDateTime, number of seats available for session (tsMaxRegistration – number of students already scheduled for the session)
Where
1. the most recent tnTestCode for the studentID displayed on the form tblStudentTestNeeds (it is logged in by tnDateEntered) is in the list of tsTestTypes (a comma separated list) in tblTestSessions.
2. the number of students already scheduled is less than the tsMaxRegistration, ap.aptSession contains the tsTestSessionID and are not canceled (ap.aptCancel)
Tables:
tblTestSessions [ts] fields:
tsTestSessionID, tsTestTypes, tsTestSessionDateTime, tsMaxRegistration, tsMaxRegistrationOverride, tsRoom
tblStudentAppointments [ap] fields:
aptRecordID, aptStudentID, aptTestCode, aptSession, aptPresent, aptDateCompleted,
aptIncomplete, aptEmail, aptPrint, aptCancel, aptDateAdded, aptDateSentEmail,
aptDateSentPrinted, aptModified, ResendETicket, ResendPTicket
tblStudentTestNeeds [tn] fields:
tnRecordID, tnStudentID, tnTestCode, tnDateEntered
Form Used:
frmAppointmentScheduling
Need to obtain:
ts.tsTestSessionID, ts.tsTestSessionDateTime, number of seats available for session (tsMaxRegistration – number of students already scheduled for the session)
Where
1. the most recent tnTestCode for the studentID displayed on the form tblStudentTestNeeds (it is logged in by tnDateEntered) is in the list of tsTestTypes (a comma separated list) in tblTestSessions.
2. the number of students already scheduled is less than the tsMaxRegistration, ap.aptSession contains the tsTestSessionID and are not canceled (ap.aptCancel)
Tables:
tblTestSessions [ts] fields:
tsTestSessionID, tsTestTypes, tsTestSessionDateTime, tsMaxRegistration, tsMaxRegistrationOverride, tsRoom
tblStudentAppointments [ap] fields:
aptRecordID, aptStudentID, aptTestCode, aptSession, aptPresent, aptDateCompleted,
aptIncomplete, aptEmail, aptPrint, aptCancel, aptDateAdded, aptDateSentEmail,
aptDateSentPrinted, aptModified, ResendETicket, ResendPTicket
tblStudentTestNeeds [tn] fields:
tnRecordID, tnStudentID, tnTestCode, tnDateEntered
Form Used:
frmAppointmentScheduling