I'm trying to write a query that finds any category that is not on of the ususal ones. so I have: SELECT Crinc.CENTER
FROM Crinc
WHERE (((Crinc.CENTER) Not Like "ER" And (Crinc.CENTER) Not Like "WR" And (Crinc.CENTER) Not Like "SE" And (Crinc.CENTER) Not Like "RO")) OR (((Crinc.CENTER) Is Null));
which works - Actually it's much longer but it works.
Then I realized I'd fogotten the date field so they user can select a month, six months etc so I added the date but then things got really weird. I can make this work:
SELECT Crinc.TRANS_DT, Crinc.CENTER, Crinc.BIL_NAME
FROM Crinc
WHERE (((Crinc.TRANS_DT) Between [Forms]![Crinc Query Menu]![startdate] And [Forms]![Crinc Query Menu]![EndDate]) AND ((Crinc.CENTER)<>"SE"));
Which gives me everything for the specified date range and no "SE"s in the
FROM Crinc
WHERE (((Crinc.CENTER) Not Like "ER" And (Crinc.CENTER) Not Like "WR" And (Crinc.CENTER) Not Like "SE" And (Crinc.CENTER) Not Like "RO")) OR (((Crinc.CENTER) Is Null));
which works - Actually it's much longer but it works.
Then I realized I'd fogotten the date field so they user can select a month, six months etc so I added the date but then things got really weird. I can make this work:
SELECT Crinc.TRANS_DT, Crinc.CENTER, Crinc.BIL_NAME
FROM Crinc
WHERE (((Crinc.TRANS_DT) Between [Forms]![Crinc Query Menu]![startdate] And [Forms]![Crinc Query Menu]![EndDate]) AND ((Crinc.CENTER)<>"SE"));
Which gives me everything for the specified date range and no "SE"s in the
field BUT I also lose all the records where
is blank. So I added Is Null to the
field and then I get ALL the dates, not just the ones I asked for. Yet in the first example above I have IS Null and a few other designations in the
field and it works fine. Can anyone see what the problem is? It seems the Date 'Between' part is messing the rest of it up but I don't know why.