Repeat Entries in Query Result

C

Chris Aslett

I have a query which is returning muliptle results of the
same record so that the subsequent report has an
identicle line item appreaing between to anf ive times.
What am I doing wrong?
 
M

Michel Walsh

Hi,

You use an inner join and one of the table have duplicated values (in fact 5
times duplicated) in the field implied in the join.


Table1
f1 f2 'fields
a 1
b 2
c 3 'data


Table2
g1 g2 'fields
alpha 1
beta 1
gamma 1 'data


SELECT f1, f2, g1 FROM table1 INNER JOIN table2 ON table1.f2=table2.g2

results into:

f1 f2 g1
a 1 alpha
a 1 beta
a 1 gamma



where you observe that ( a, 1) is now tri-plicated:


SELECT f1, f2 FROM table1 INNER JOIN table2 ON table1.f2=table2.g2
would look even stranger (we just drop g1 from the SELECTed list) :

f1 f2
a 1
a 1
a 1



That is probably what you have.




Hoping it may help,
Vanderghast, Access MVP
 

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