Probably easy for you, but not a noob like me!

B

bkatzman1

Hey All,

I have a small table with only about 19,000 records. The fields are:
ID, Establishment, Address, City, State, ZIP, Address2, City2, State2,
Zip2

My question is: How can I print the Establishment field only if
Address2, City2, State2, Zip2 are not blank?

Thanks for any help and please remember I am a noob.
Bryce
 
G

Guest

SELECT Establishment
FROM YourTable
WHERE Address2 Is Not Null
AND City2 Is Not Null
AND State2 Is Not Null
AND Zip2 Is Not Null;

This makes a few assumptions:
1. That you mean all fields must be not be blank. If it's OK to have
something like City2 empty, change the AND's to OR's.

2. By "blank" you mean null. It's also possible that there are empty strings
or some character that makes it look blank such as a space in the field. If
you get unexpected results, you may need to trap for spaces and empty strings.
 

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

Top