query without blank records

M

mabyn

I am trying to change a query I have to narrow down some information. In this
query I work with 2 tables to gather data. If the field Registration.[Entry
Name] is blank I do not want anything to show up. Do I type WHERE
Registration.[Entry Name] is NULL, " "

SQL:
SELECT Registration.[Group Placed In], Registration.RegistrationID,
Registration.[Entry Name], Attendees.AttendeeFirstName,
Attendees.AttendeeLastName, Attendees.CompanyName
FROM Attendees INNER JOIN Registration ON Attendees.AttendeeID =
Registration.AttendeeID;
 
K

KARL DEWEY

SELECT Registration.[Group Placed In], Registration.RegistrationID,
Registration.[Entry Name], Attendees.AttendeeFirstName,
Attendees.AttendeeLastName, Attendees.CompanyName
FROM Attendees INNER JOIN Registration ON Attendees.AttendeeID =
Registration.AttendeeID
WHERE Registration.[Entry Name] Is Not NULL;
 
J

Jerry Whittle

"Blank" can be a problem as it includes Nulls, Zero Length Strings, and
possibly something that looks blank like spaces.

Try running your query with each of the following criteria. If it returns
any records for any of the criteria, they you'll know what kind of data that
you have to work with.

WHERE Registration.[Entry Name] is NULL ;

WHERE Registration.[Entry Name] Like " *" ;

WHERE Registration.[Entry Name] = "" ;

To not return those records change it to :

WHERE Registration.[Entry Name] is NOT NULL ;

WHERE Registration.[Entry Name] NOT Like " *" ;

WHERE Registration.[Entry Name] <> "" ;
 

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