query without blank records

  • Thread starter Thread starter mabyn
  • Start date Start date
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;
 
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;
 
"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] <> "" ;
 
Back
Top