Query for fields w/ no data (null?)

S

stephen.belyea

In the database I am working on, I would like to be able to create a
report with a list of all the properties in the database, accompianed
by the date of when the property was inspected. Some properties have
never been inspected, and therefore do not have an inspection date -
or even an entry in tblInspection. Is there a way for me to build a
query that displays all of the properties as well as the date they
were inspected, even if they were never inspected?

tblProperty.PropStreet = is the field for the property, and
tblInspection.InspDate = is the field for the inspection date.

Thanks!
 
J

John Spencer

You need to build a query that uses an outer join.

SQL would look like
SELECT tblProperty.PropStreet, tblInspection.InspDate
FROM tblProperty LEFT JOIN tblInspection
ON tblProperty.PropertyID = tblInspection.PropertyID

In the query grid:
-- Add both tables
-- Join the propertyId fields
-- Double click on the join line and choose All tblProperty and Matching
tblInspection
-- Select the fields you want to see

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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