Duplicate Returns.

A

Andrew

Sometimes when I do a query, I get the record listed twice (or more) after
hitting Run. The records aren't duplicated in the table, so why am I getting
two results?
 
A

Allen Browne

If your query uses multiple tables with one-to-many relations, the records
from the ONE side of the relation will appear on as many rows as there are
records in the related table.

For example, if you have tables for Customers, Invoices, and Payments. If an
invoice was paid in 2 instalments, the invoice will appear twice because
there are 2 payments for it.
 
A

Andrew

Thanks. I thought of that as soon as I posted this.

Is there any easy way to tell Access to only list each record once? Even if
there is multiple entries in another table?
 
A

Allen Browne

Create a query on just the other table. In that query, GROUP BY the field
that should appear once only, and choose First or Sum or whatever for the
other field(s.)

Then use that query as an input 'table' for your main query, instead of the
problem table. Since it only has ONE record for each key field, you won't
get duplicated records.
 

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

Top