sam1fletcher
Registered User.
- Local time
- Today, 17:37
- Joined
- Jan 28, 2013
- Messages
- 40
hi
I have a problem with my query. the problem: i have a table of schools(tblschool) the table has a County feild which is text and 2 Y/N feild called HMC and GSA.
i want to be able to retreived records that are in a specific county and have one of these ticked. Simple rite! but the problem arrises when a school has both ticked as they dont come up in either search. the search has to be both HMC and GSA in a county to get that school.
my code so far
SELECT *
FROM tblSchool
WHERE (((tblSchool.County)=Forms!frmSchoolSelect!County) And (((tblSchool.HMC)=Forms!frmSchoolSelect!HMC) or ((tblSchool.GSA)=Forms!frmSchoolSelect!GSA)));
but this seems to retreive pretty much every school in a county. not just a hmc or a gsa
I have a problem with my query. the problem: i have a table of schools(tblschool) the table has a County feild which is text and 2 Y/N feild called HMC and GSA.
i want to be able to retreived records that are in a specific county and have one of these ticked. Simple rite! but the problem arrises when a school has both ticked as they dont come up in either search. the search has to be both HMC and GSA in a county to get that school.
my code so far
SELECT *
FROM tblSchool
WHERE (((tblSchool.County)=Forms!frmSchoolSelect!County) And (((tblSchool.HMC)=Forms!frmSchoolSelect!HMC) or ((tblSchool.GSA)=Forms!frmSchoolSelect!GSA)));
but this seems to retreive pretty much every school in a county. not just a hmc or a gsa