How to select one record from a table with duplicate records - TechRepublic
Question
December 21, 2010 at 11:26 AM
mmunitz

How to select one record from a table with duplicate records

by mmunitz . Updated 15 years, 6 months ago

I have an Access query in which I need to use a table that has multiple occurrences of a data field I need, and when I join it to my query it causes the entire query to display multiple records.

The table name is tbl_JOINTDATA.
The data fields that are causing duplicate records JOINT_TOUR_END and JOINT_TOUR_START. I only want to retrieve the record if JOINT_TOUR_START IS NOT NULL and JOINT_TOUR_END is NULL. I used the following:
JOINT START: IIf(IsNull([tbl_JOINTDATA.JOINT_TOUR_END]),([tbl_JOINTDATA.JOINT_TOUR_START]))

It displayed the correct JOINT_TOUR_START with the associated NULL JOINT_TOUR_END, but still creates duplicate records.

I need to know how to get that one occurrence of JOINT_TOUR_START when JOINT_TOUR_END is NULL.

Thanks.

This discussion is locked

All Comments