G
Guest
Hello. I have a table in which i need to make a query that excludes records
if one of the columns is equal to one of two values. I have made the query,
and it does some strange things. The query was built in the query design
window.
SELECT tblSumRural.ZIPCODE, tblSumRural.CARRIER_ROUTE_ID, tblSumRural.AR,
tblSumRural.AB, tblSumRural.TOTAL, tblSumRural.CR, tblSumRural.PMonly
FROM tblSumRural
WHERE (((tblSumRural.CARRIER_ROUTE_ID)<>"G000" Or
(tblSumRural.CARRIER_ROUTE_ID)<>"G099") AND ((tblSumRural.PMonly)=1));
If i take out one of the CARRIER_ROUTE_ID conditions, it works great for the
one that is left in. For example, if i remove the condition for
CARRIER_ROUTE_ID<>"G099", it removes the records that have CARRIER_ROUTE_ID
equal to "G000", just like it should. But if both conditions are there, it
does not remove ANY recordrs and includes the ones with G000 and G099 in
them.
So how am i breaking the query by including two conditions? In either case,
the PMonly = 1 works, but that's not an exclusion, since it's looking for
records where PMonly equals 1.
Thanks for any help!!
Brian
if one of the columns is equal to one of two values. I have made the query,
and it does some strange things. The query was built in the query design
window.
SELECT tblSumRural.ZIPCODE, tblSumRural.CARRIER_ROUTE_ID, tblSumRural.AR,
tblSumRural.AB, tblSumRural.TOTAL, tblSumRural.CR, tblSumRural.PMonly
FROM tblSumRural
WHERE (((tblSumRural.CARRIER_ROUTE_ID)<>"G000" Or
(tblSumRural.CARRIER_ROUTE_ID)<>"G099") AND ((tblSumRural.PMonly)=1));
If i take out one of the CARRIER_ROUTE_ID conditions, it works great for the
one that is left in. For example, if i remove the condition for
CARRIER_ROUTE_ID<>"G099", it removes the records that have CARRIER_ROUTE_ID
equal to "G000", just like it should. But if both conditions are there, it
does not remove ANY recordrs and includes the ones with G000 and G099 in
them.
So how am i breaking the query by including two conditions? In either case,
the PMonly = 1 works, but that's not an exclusion, since it's looking for
records where PMonly equals 1.
Thanks for any help!!
Brian