mjstone323
Technical User
I apologize if this has been answered elsewhere - I'm having trouble formulating my question, and thus it's difficult to know what to search for!
I have a query such that the result is displayed in two related select boxes:
SELECT School.SchoolID, School.SchoolName, School.SchoolOpen, Employee.EmployeeID, Employee.SchoolID, Employee.CertificationTracking, Employee.FirstName, Employee.LastName, (Employee.FirstName + ' ' + Employee.LastName) as TeacherName
FROM School, Employee
WHERE SchoolOpen <> 0 AND Employee.SchoolID = School.SchoolID AND Employee.CertificationTracking <> 0
ORDER BY School.SchoolName, LastName, FirstName
These are employees who are being tracked for certification. Not all the employees are being tracked, so I created a boolean column (CertificationTracking). The above query works great.
It turns out that other employees would like to attend the workshops, who aren't being tracked for certification, so I created another boolean column (AttendsWorkshops) and tried to list them along with the other, tracked employees thusly:
...
WHERE SchoolOpen <> 0 AND Employee.SchoolID = School.SchoolID AND Employee.CertificationTracking <> 0 OR Employee.AttendsWorkshops <> 0
...
But this resulted in all schools, whether or not they're open, and all teachers, whether or not they're being tracked, to be listed.
My brain is frozen. What am I doing wrong?
I have a query such that the result is displayed in two related select boxes:
SELECT School.SchoolID, School.SchoolName, School.SchoolOpen, Employee.EmployeeID, Employee.SchoolID, Employee.CertificationTracking, Employee.FirstName, Employee.LastName, (Employee.FirstName + ' ' + Employee.LastName) as TeacherName
FROM School, Employee
WHERE SchoolOpen <> 0 AND Employee.SchoolID = School.SchoolID AND Employee.CertificationTracking <> 0
ORDER BY School.SchoolName, LastName, FirstName
These are employees who are being tracked for certification. Not all the employees are being tracked, so I created a boolean column (CertificationTracking). The above query works great.
It turns out that other employees would like to attend the workshops, who aren't being tracked for certification, so I created another boolean column (AttendsWorkshops) and tried to list them along with the other, tracked employees thusly:
...
WHERE SchoolOpen <> 0 AND Employee.SchoolID = School.SchoolID AND Employee.CertificationTracking <> 0 OR Employee.AttendsWorkshops <> 0
...
But this resulted in all schools, whether or not they're open, and all teachers, whether or not they're being tracked, to be listed.
My brain is frozen. What am I doing wrong?