Query Criteria Question

R

Ray Todd Jr

I have the following query:

SELECT taPROPERTY.PropertyID, taPROPERTY.CLT, taDEFENDANTNAMES.Zip,
taDEFENDANTNAMES.LastName, taDEFENDANTNAMES.FirstName,
taDEFENDANTNAMES.MiddleName, taDEFENDANTNAMES.Suffix,
taDEFENDANTNAMES.Address1, taDEFENDANTNAMES.Address2, taDEFENDANTNAMES.City,
taDEFENDANTNAMES.State
FROM taPROPERTY INNER JOIN (taDEFENDANTNAMES INNER JOIN taDEFENDANTS ON
taDEFENDANTNAMES.DefendantsNameID = taDEFENDANTS.DefendantsNameID) ON
taPROPERTY.PropertyID = taDEFENDANTS.PropertyID
WHERE (((taDEFENDANTNAMES.Zip)="37901"))
ORDER BY taDEFENDANTNAMES.Zip;

If I change the where clause to a NOT (i.e., I don't want that particular
zip code), I still get that zip code included in the output. What am I doing
wrong here. The datatype for the zip code is text. If I remove the NOT (as
the sql is above), I ONLY receive the zipcode that is in the criteria.
 
D

Duane Hookom

Use <> for not equal. If this still doesn't seem to work, you may have
trailing spaces or something beyond the normal 5 characters.
 
R

Ray Todd Jr

Thanks Duane. You were right in that I had some trailing spaces to the zip
code which prevented this from property working. That has been corrected and
it now works.

Again,

Thanks...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top