Query for fields w/ no data (null?)

  • Thread starter Thread starter stephen.belyea
  • Start date Start date
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!
 
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
..
 
Back
Top