Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Unmatched records

Status
Not open for further replies.

Sussex

MIS
Nov 13, 2001
12
US
Hello, I have two tables one called assignments and one called complete.
The fields in Assignment are
id
asdate
park
survey
assigned
loaddate

The fields in complete are
id
codate
park
survey
completed
loaddate

The purpose of the report is to find out what someone was assigned versus what they completed by survey for a particular day. They are related by id, asdate and codate, park and survey (each person is assigned more then one type of survey each day). The problem I am having is that when someone was assigned something but they did not complete any, they are not showing up in my report has having missed anything since there is no corresponding record for complete. The problem also exists in reverse if someone did something extra that they were not assigned that is not showing also. The way I calculate percent of work completed is complete/assigned in a percentage format. My reports run fine for someone who has corresponding assignments and completes but the total slackers are getting a free pass if they do nothing. It has been driving me crazy. I have tried the unmatched query wizard and it is not giving me what I need. What is the best way to solve this? Thanks!
 
This should get you the "slackers":

Select A.* from Assignment A
left outer join Complete C
on A.id = C.id
and A.park = C.park
and A.survey = C.survey
Where C.id

And this should get you the overachievers:

Select C.* from Complete C
left outer join Assignment A
on C.id = A.id
and C.park = A.park
and C.survey = A.survey
Where A.id
 
Thanks lynchg for your speedy response! I tried it and the query seems to return everthing that that person was assigned for the day. It does not seem to be returning just the assigns that have no corresponding completes.
For example
user 1490 was assigned for 12/12 lets say
25 of survey type 1
25 of survey type 2
25 of survey type 3
25 of survey type 4

1490 completes
25 survey type 1
25 survey type 2
0 survey type 3
25 survey type 4

I need to show 1490 at 75% for the day.Under my present queries 1490 would show at 100% since there is no corresponding complete for the 25 assigned.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top