Where... And Not...

bob bisquick

Registered User.
Local time
Today, 14:44
Joined
Nov 8, 2002
Messages
37
I've got a database with clients and services.

ServiceA1
ServiceA2
ServiceA3

ServiceB1
ServiceB2
ServiceB3

I am trying to write a Query to get all the clients who received a B group service, but excluding any clients who got both A and B services.

I wrote it thusly (in criteria for service code):

Where (SerivceB1 or ServiceB2 or ServiceB3) and Not ((ServiceA1 or Service A2 or Service A3) and (SerivceB1 or ServiceB2 or ServiceB3))

This simply returns no results at all. I'm not sure if it's a syntax issue, or what...
 
Couple things - you have some spaces in the field names in the where clause - that might be part of it. Try the following:

Where (SerivceB1 or ServiceB2 or ServiceB3) and Not ServiceA1 and not ServiceA2 and not ServiceA3)

GumbyD
 
Thanks

Thanks Pat, that di the trick!
 

Users who are viewing this thread

Back
Top Bottom