I have a query:
SELECT Crinc.TRANS_DT, Crinc.CENTER, Crinc.BIL_NAME, Crinc.ROUTE, Crinc.PROD_LIST, Crinc.CARRIER, Crinc.WEIGH_NET
FROM Crinc
WHERE (((Crinc.TRANS_DT) Between [Forms]![Crinc Query Menu]![startdate] And [Forms]![Crinc Query Menu]![EndDate]) AND ((Crinc.CENTER) Not Like "ER" And (Crinc.CENTER) Not Like "WR" And (Crinc.CENTER) Not Like "SE" And (Crinc.CENTER) Not Like "RO" And (Crinc.CENTER) Not Like "NR")) OR (((Crinc.TRANS_DT) Between [Forms]![Crinc Query Menu]![startdate] And [Forms]![Crinc Query Menu]![EndDate]) AND ((Crinc.BIL_NAME) Not Like "*Scott*" And (Crinc.BIL_NAME) Not Like "*Science*" And (Crinc.BIL_NAME) Not Like "*Mesa*" And (Crinc.BIL_NAME) Not Like "Diamond*" And (Crinc.BIL_NAME) Not Like "Fred*" And (Crinc.BIL_NAME) Not Like "*Nutrition" And (Crinc.BIL_NAME) Not Like "*LadLaw*"));
but it won't do the first part. I still get records that have ER etc. in the
SELECT Crinc.TRANS_DT, Crinc.CENTER, Crinc.BIL_NAME, Crinc.ROUTE, Crinc.PROD_LIST, Crinc.CARRIER, Crinc.WEIGH_NET
FROM Crinc
WHERE (((Crinc.TRANS_DT) Between [Forms]![Crinc Query Menu]![startdate] And [Forms]![Crinc Query Menu]![EndDate]) AND ((Crinc.CENTER) Not Like "ER" And (Crinc.CENTER) Not Like "WR" And (Crinc.CENTER) Not Like "SE" And (Crinc.CENTER) Not Like "RO" And (Crinc.CENTER) Not Like "NR")) OR (((Crinc.TRANS_DT) Between [Forms]![Crinc Query Menu]![startdate] And [Forms]![Crinc Query Menu]![EndDate]) AND ((Crinc.BIL_NAME) Not Like "*Scott*" And (Crinc.BIL_NAME) Not Like "*Science*" And (Crinc.BIL_NAME) Not Like "*Mesa*" And (Crinc.BIL_NAME) Not Like "Diamond*" And (Crinc.BIL_NAME) Not Like "Fred*" And (Crinc.BIL_NAME) Not Like "*Nutrition" And (Crinc.BIL_NAME) Not Like "*LadLaw*"));
but it won't do the first part. I still get records that have ER etc. in the
field.
If I change the OR to another AND (that is, I leave the [Bil_Name] requirements on the same line in the Query Design screen):
SELECT Crinc.TRANS_DT, Crinc.CENTER, Crinc.BIL_NAME, Crinc.ROUTE, Crinc.PROD_LIST, Crinc.CARRIER, Crinc.WEIGH_NET
FROM Crinc
WHERE (((Crinc.TRANS_DT) Between [Forms]![Crinc Query Menu]![startdate] And [Forms]![Crinc Query Menu]![EndDate]) AND ((Crinc.CENTER) Not Like "ER" And (Crinc.CENTER) Not Like "WR" And (Crinc.CENTER) Not Like "SE" And (Crinc.CENTER) Not Like "RO" And (Crinc.CENTER) Not Like "NR") AND ((Crinc.BIL_NAME) Not Like "*Scott*" And (Crinc.BIL_NAME) Not Like "*Science*" And (Crinc.BIL_NAME) Not Like "*Mesa*" And (Crinc.BIL_NAME) Not Like "Diamond*" And (Crinc.BIL_NAME) Not Like "Fred*" And (Crinc.BIL_NAME) Not Like "*Nutrition" And (Crinc.BIL_NAME) Not Like "*LadLaw*"));
I don't get any data for results, but I know there are about 150 records that don't meet any of the requirements. From what I understand the first way should work. Can anyone see what's wrong?
If I change the OR to another AND (that is, I leave the [Bil_Name] requirements on the same line in the Query Design screen):
SELECT Crinc.TRANS_DT, Crinc.CENTER, Crinc.BIL_NAME, Crinc.ROUTE, Crinc.PROD_LIST, Crinc.CARRIER, Crinc.WEIGH_NET
FROM Crinc
WHERE (((Crinc.TRANS_DT) Between [Forms]![Crinc Query Menu]![startdate] And [Forms]![Crinc Query Menu]![EndDate]) AND ((Crinc.CENTER) Not Like "ER" And (Crinc.CENTER) Not Like "WR" And (Crinc.CENTER) Not Like "SE" And (Crinc.CENTER) Not Like "RO" And (Crinc.CENTER) Not Like "NR") AND ((Crinc.BIL_NAME) Not Like "*Scott*" And (Crinc.BIL_NAME) Not Like "*Science*" And (Crinc.BIL_NAME) Not Like "*Mesa*" And (Crinc.BIL_NAME) Not Like "Diamond*" And (Crinc.BIL_NAME) Not Like "Fred*" And (Crinc.BIL_NAME) Not Like "*Nutrition" And (Crinc.BIL_NAME) Not Like "*LadLaw*"));
I don't get any data for results, but I know there are about 150 records that don't meet any of the requirements. From what I understand the first way should work. Can anyone see what's wrong?