Question : How do I write a query to select which unique value I want to produce?

I have a query that is going to combine two databases. The first one gathers all of the records based on a phone call and the tracking system used by customer service. The second is the ticket system from the trucks. I ran a query that grabs all of the records from CS and then the second query pulls all of the 1st query records plus adds the truck tickets for all of those records based on the main number used to track each run. Each run for a truck can have multiple packages. I want to see:

Date - Truck - Run# - Package#
8/15     12        1234       1697
8/15     12        1234       1698 (2nd package)
8/15     12        1235       1699
8/15     12        1236       1670
8/15     12        1236       1671 (2nd package)

(three trips and five packages)

Because there are two matching packages on the truck side and two on the run side I am getting:

Date - Truck - Run# - Package#
8/15     12        1234       1697
8/15     12        1234       1697 (Duplicate of 2nd package)
8/15     12        1234       1698
8/15     12        1234       1698 (Duplicate of 2nd package)
8/15     12        1235       1699
8/15     12        1236       1670
8/15     12        1236       1670 (Duplicate of 2nd package)
8/15     12        1236       1671
8/15     12        1236       1671 (Duplicate of 2nd package)

(three trips but nine counted - five actual packages)

I have used both SELECT DISTINCTROW and SELECT DISTINCT and neither is working. Any thoughts?

Answer : How do I write a query to select which unique value I want to produce?

I resolved the issue - thank you for the help. I created a make-table query, set all of the field names, deleted the data and changed the field that was duplicating to Indexed - no duplicates; erased all of the data within the table and re-ran the query as an append - then got a new query to extract all of the data in the new query which removed all of the duplicate records. Long work-around, but the end-result is the one I needed.
Random Solutions  
 
programming4us programming4us