If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Duplicate Returns.
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? |
#2
|
|||
|
|||
Duplicate Returns.
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. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Andrew" wrote in message ... 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? |
#3
|
|||
|
|||
Duplicate Returns.
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? "Allen Browne" wrote: 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. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Andrew" wrote in message ... 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? . |
#4
|
|||
|
|||
Duplicate Returns.
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. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Andrew" wrote in message ... 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? "Allen Browne" wrote: 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. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Andrew" wrote in message ... 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? . |
Thread Tools | |
Display Modes | |
|
|