View Full Version : Problem with duplicate records in a query-causing wierd thing!


phishbfm
08-06-2004, 08:13 AM
I've got a query where i am joining two other queries. when i run the query, i get some duplicate entries. but at datasheet view, i can run a sort either asceding or descending and the dups are removed. This doesn't work if i set a sort at design view, only at datasheet.

what can i do to get rid of these dups!??!

KenHigg
08-06-2004, 08:28 AM
I would guess that you really are not getting real so called duplicates. Rather, by the nature of your join, some data on one side has to repeat because there are multiple records on the other side that are linked back.

Example:

tblX
pkX, infoX1, infoX2
001, aaa, bbb
002, ccc, ddd
003, eee, fff

tblY
pkY, fkX, infoY1, infoY2
100, 001, mmm, nnn
200, 001, ooo, ppp
300, 002, qqq, rrr

A joined query would return:

pkX, infoX1, infoX2, pky, infoY1, infoY2
001, aaa, bbb, 100, mmm, nnn
001, aaa, bbb, 200, ooo, ppp
002, ccc, ddd, 300, qqq, rrr
...
...
...



Make sense?
(I think all this is correct)
ken

phishbfm
08-06-2004, 08:40 AM
I fixed it! Thanks!