T-SQL Select

I am using T-SQL (SQL Server 2000) and I want to exclude customers who meet two different criteria simultaneously.  For example below:
Select * from Customers
where
State = 'New York'
and
PurchaseDate <'2012-10-01'
The problem is I don't want to exclude all Customers who state = 'New York'
only those customers that meet both criteria do I want to exclude.  Any ideas on how to do this?  Thanks for the help.
LVL 3
fjkaykr11Asked:
Who is Participating?
 
Kelvin SparksConnect With a Mentor Commented:
You speak of excluding New York but the current SQL selectsd only New York and where the Pruchase date is < 2012-10-01. Please clarify
0
 
fjkaykr11Author Commented:
sorry I meant to write this with
State <>'New York'
0
 
fjkaykr11Author Commented:
I think I figured it out.  Please advise if this is correct
Select * from Customers
where not (State = 'New York' and PurchaseDate <'2012-10-01')
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
Kelvin SparksCommented:
Yes, That would have been what I would have suggested - will give you everyone other that those in New York with a purchase date prior to 1 October last year.


Kelvin
0
 
fjkaykr11Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for fjkaykr11's comment #a38821264
Assisted answer: 250 points for kelvinsparks's comment #a38821201
Assisted answer: 250 points for kelvinsparks's comment #a38821276

for the following reason:

thanks
0
 
Kelvin SparksCommented:
That doesn't need a close request - just accept and share the points to my solutions. This closes the question.

Kelvin
0
 
fjkaykr11Author Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.