Hi Mate,
Been having a further play with this query and it seems to have a slight problem.
If I add extra records to the table that have the same quantity but are a different Item, Location they don't get returned in the query.
Maybe I confused things from the beginning or didn't explain properly.....
The table is populated by two users counting items in a store room.
So there should be one record from each person for each Item/Location pairing. The quantities may or may not be the same.
It is also possible for one user to miss counting an item altogether, therefore there would only be one record for the Item/Location.
I'm looking for the query to return all records that don't match. So it should return and mismatch quantities for a Item/Location pairing and also any single record Item/Location entries.
That probably makes no sense at all!
So back to the table:
Quote:
ID ZONE LOCN. ITEM USER DATE COUNT
1 FG ABC1 123456 MAJ 25/10/2005 10
2 FG ABC1 123456 DAV 25/10/2005 10
3 FG ABC2 654321 MAJ 25/10/2005 15
4 FG ABC2 654321 DAV 25/10/2005 14
5 FG ABC3 999999 DAV 25/10/2005 20
|
this should return the following:
Quote:
ID ZONE LOCN. ITEM USER DATE COUNT
3 FG ABC2 654321 MAJ 25/10/2005 15
4 FG ABC2 654321 DAV 25/10/2005 14
5 FG ABC3 999999 DAV 25/10/2005 20
|
Because ID 2 and 3 have a matching Item/Location/Count they are not returned because they are correct.
ID 3 and 4 are both returned, because although they have a matching Item/Location, the Counts are different.
ID 5 is returned because it is a single entry record, so one user didn't count it.
Hope that makes some sense.
Thanks again.