Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Exclude data

Status
Not open for further replies.

epkiran

Programmer
Jun 26, 2001
7
SE
I want to exclude a value,

in this case list all students with lastname Andersson
and where firstname is not Irene.


SELECT name
FROM student
WHERE lastname='andersson' and firstname is not Irene???

What do I do?
 
This is a quick amatuerism attempt.

SELECT tblStudentsNames.FirstName, tblStudentsNames.LastNameSurname
FROM tblStudentsNames
GROUP BY tblStudentsNames.FirstName, tblStudentsNames.LastNameSurname
HAVING ((Not (tblStudentsNames.FirstName)=[enter firstname]) AND ((tblStudentsNames.LastNameSurname)=[enter surname]))


HTH

David

 
Try this out:

SELECT name
FROM student
WHERE lastname = 'andersson' AND firstname <> 'Irene';

That should do it Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top