M
Michael Horne
Need a little help here. I have a table that collects information on
Referrals made to each Contractor from each Worker. I need a query to return
results for us to contact the Worker and survey them on their Client
experience at the Contractor.
Referral table has 6936 records
The ID field is an autonumber field.
I have created qryReferral1 (6936 records returned) below:
SELECT tblReferrals.ID, tblReferrals.[Contract #], tblReferrals.[Contract
Name], tblReferrals.[Client Name], tblReferrals.Service, tblReferrals.[Visit
Date], tblReferrals.[Worker Name], CStr(tblReferrals.[Contract
#])+tblReferrals.[Worker Name] AS horne
FROM tblReferrals
ORDER BY tblReferrals.[Contract #], tblReferrals.[Worker Name];
I have created qryReferral2 (3149 records returned) below:
SELECT DISTINCT qryReferrals1.horne, qryReferrals1.[Contract #]
FROM qryReferrals1;
I must have the field ID in the results, but when I add, it returns every
row! (6936) How do I get it to only return the ID for the row I need?
Referral table contains this data below:
"ID" "Contractor Name" "Contract #" "Client Name" "Visit Date" "Service"
"Worker ID" Worker Name"
1 "Pizza Hut" "100" "Mouse, Micky" "01/01/2009" "Lunch" "1234" "Sikes, Sam"
<--- return this one
2 "Pizza Hut" "100" "Mouse, Minnie" "01/01/2009" "Lunch" "1234" "Sikes, Sam"
3 "Pizza Hut" "100" "Mouse, Joe" "01/01/2009" "Lunch" "1234" "Sikes, Sam"
4 "Pizza Hut" "100" "Mouse, Henry" "01/01/2009" "Lunch" "1234" "Sikes, Sam"
5 "Pizza Hut" "100" "Mouse, Micky" "05/05/2009" "Lunch" "1234" "Sikes, Sam"
6 "Pizza Hut" "100" "Mouse, Minnie" "06/01/2009" "Dinner" "1234" "Sikes, Sam"
7 "Cheese Cafe" "2309" "Mouse, Micky" "03/06/2009" "Lunch" "1234" "Sikes,
Sam" <--- return this one
8 "Cheese Cafe" "2309" "Mouse, Minnie" "04/07/2009" "Breakfast" "1234"
"Sikes, Sam"
9 "Tim's Tacos" "4110" "Jones, Roy" "02/14/2009" "Dinner" "1234" "Sikes,
Sam" <--- return this one
10 "Tim's Tacos" "4110" "Jones, Tamera" "02/14/2009" "Dinner" "1234" "Sikes,
Sam"
11 "Tim's Tacos" "4110" "Mouse, Henry" "02/01/2009" "Breakfast" "9111"
"Castro, Kim" <--- return this one
12 "Lisa's Tofu" "1999" "Lee, Wu" "02/01/2009" "Breakfast" "3007" "Clay,
Cassius" <--- return this one
13 "Pizza Hut" "100" "Mouse, Minnie" "06/01/2009" "Lunch" "3007" "Clay,
Cassius " <--- return this one
14 "Smoothie King" "25860" "Pitts, Omar" "03/15/2009" "Lunch" "7746"
"Dodger, Ron" <--- return this one
15 "Smoothie King" "25860" "Pitts, Emma" "03/15/2009" "Lunch" "7746"
"Dodger, Ron"
16 "Smoothie King" "25860" "Pitts, Salma" "03/15/2009" "Lunch" "7746"
"Dodger, Ron"
Thanks for any help!
Referrals made to each Contractor from each Worker. I need a query to return
results for us to contact the Worker and survey them on their Client
experience at the Contractor.
Referral table has 6936 records
The ID field is an autonumber field.
I have created qryReferral1 (6936 records returned) below:
SELECT tblReferrals.ID, tblReferrals.[Contract #], tblReferrals.[Contract
Name], tblReferrals.[Client Name], tblReferrals.Service, tblReferrals.[Visit
Date], tblReferrals.[Worker Name], CStr(tblReferrals.[Contract
#])+tblReferrals.[Worker Name] AS horne
FROM tblReferrals
ORDER BY tblReferrals.[Contract #], tblReferrals.[Worker Name];
I have created qryReferral2 (3149 records returned) below:
SELECT DISTINCT qryReferrals1.horne, qryReferrals1.[Contract #]
FROM qryReferrals1;
I must have the field ID in the results, but when I add, it returns every
row! (6936) How do I get it to only return the ID for the row I need?
Referral table contains this data below:
"ID" "Contractor Name" "Contract #" "Client Name" "Visit Date" "Service"
"Worker ID" Worker Name"
1 "Pizza Hut" "100" "Mouse, Micky" "01/01/2009" "Lunch" "1234" "Sikes, Sam"
<--- return this one
2 "Pizza Hut" "100" "Mouse, Minnie" "01/01/2009" "Lunch" "1234" "Sikes, Sam"
3 "Pizza Hut" "100" "Mouse, Joe" "01/01/2009" "Lunch" "1234" "Sikes, Sam"
4 "Pizza Hut" "100" "Mouse, Henry" "01/01/2009" "Lunch" "1234" "Sikes, Sam"
5 "Pizza Hut" "100" "Mouse, Micky" "05/05/2009" "Lunch" "1234" "Sikes, Sam"
6 "Pizza Hut" "100" "Mouse, Minnie" "06/01/2009" "Dinner" "1234" "Sikes, Sam"
7 "Cheese Cafe" "2309" "Mouse, Micky" "03/06/2009" "Lunch" "1234" "Sikes,
Sam" <--- return this one
8 "Cheese Cafe" "2309" "Mouse, Minnie" "04/07/2009" "Breakfast" "1234"
"Sikes, Sam"
9 "Tim's Tacos" "4110" "Jones, Roy" "02/14/2009" "Dinner" "1234" "Sikes,
Sam" <--- return this one
10 "Tim's Tacos" "4110" "Jones, Tamera" "02/14/2009" "Dinner" "1234" "Sikes,
Sam"
11 "Tim's Tacos" "4110" "Mouse, Henry" "02/01/2009" "Breakfast" "9111"
"Castro, Kim" <--- return this one
12 "Lisa's Tofu" "1999" "Lee, Wu" "02/01/2009" "Breakfast" "3007" "Clay,
Cassius" <--- return this one
13 "Pizza Hut" "100" "Mouse, Minnie" "06/01/2009" "Lunch" "3007" "Clay,
Cassius " <--- return this one
14 "Smoothie King" "25860" "Pitts, Omar" "03/15/2009" "Lunch" "7746"
"Dodger, Ron" <--- return this one
15 "Smoothie King" "25860" "Pitts, Emma" "03/15/2009" "Lunch" "7746"
"Dodger, Ron"
16 "Smoothie King" "25860" "Pitts, Salma" "03/15/2009" "Lunch" "7746"
"Dodger, Ron"
Thanks for any help!