Displaying items that don't meet criteria

Jayce

6th Form - Chester UK
Local time
Today, 11:32
Joined
Dec 3, 2005
Messages
7
Hi, here is my query:

SELECT DISTINCT tblvisit.[Pen ID]
FROM tblvisit
WHERE (((tblvisit.[Visit Date From])<=[forms]![fRMBOOKINGAVAILABILITY]![From]) AND ((tblvisit.[Visit Date To])>=[forms]![FRMBOOKINGAVAILABILITY]![To])) OR (((tblvisit.[Visit Date From]) Between [forms]![FRMBOOKINGAVAILABILITY]![From] And [forms]![FRMBOOKINGAVAILABILITY]![to])) OR (((tblvisit.[Visit Date To]) Between [forms]![FRMBOOKINGAVAILABILITY]![From] And [forms]![FRMBOOKINGAVAILABILITY]![to]));

This successfully finds booked pens in a cattery. How though, can I get to see the pens that are free? Is there a feature that will allow me to conduct this query before conudcting another one to show the values which didn't appear? Thanks:D
 
Hi Jayce -

You can use the logical NOT to get the reverse in your WHERE clause.

E.g.
WHERE (Age > 10) AND (Age < 15)

can be reversed by

WHERE NOT ( (Age > 10) AND (Age < 15))

Note that a set of parentheses needs to go around the entire WHERE statement before using the NOT.

hth,

- g
 
!

Smashing thanks.:)
 

Users who are viewing this thread

Back
Top Bottom