Acccess Query 0 Results with Relational Table

geospatial

Active Member
Joined
Sep 2, 2008
Messages
290
I have a query that works fine. As soon as I add a table that has a relationship to the main table I start getting 0 results.

I believe the issue is that I am trying to have 3 fields as foreign keys that link back to the same primary key in another table.


For instance i have tblRaters that has information on everyone in a rating scheme.
For the rating scheme we have raters, senior raters, and reviewers. These people could all be the same person in different roles for different people.

In my tblprsnl I have a raterID, srRaterID, and reviewerID, which all link back to tblraters.raterID.

When I only have one relationship made it works. as soon as I add anymore to the tlbraters.raterID it fails.
 
or using your sample database:
Code:
SELECT prsnl.id, 
       prsnl.[last name], 
       prsnl.[first name], 
       prsnl.rank, 
       prsnl.enterpriseemail, 
       prsnl.raterid, 
       rater.raterlastname, 
       rater.raterfirstname, 
       rater.ratermi, 
       rater.rateremail, 
       prsnl.srraterid, 
       srRater.raterlastname   AS srRaterLastName, 
       srRater.raterfirstname  AS srRaterFirstName, 
       srRater.ratermi         AS srRaterMI, 
       srRater.rateremail      AS srRaterEmail, 
       prsnl.reviewerid, 
       reviewer.raterlastname  AS reviewerLastName, 
       reviewer.raterfirstname AS reviewerFirstName, 
       reviewer.ratermi        AS reviewerMI, 
       reviewer.rateremail     AS reviewerEmail 
FROM   (((prsnl prsnl 
       LEFT JOIN tblraters rater 
         ON prsnl.raterid = rater.raterid)
       LEFT JOIN tblraters srRater 
         ON prsnl.srraterid = srRater.raterid)
       LEFT JOIN tblraters reviewer 
         ON prsnl.reviewerid = reviewer.raterid) 
ORDER  BY prsnl.[last name], 
          prsnl.[first name]



Awesome...That was it. Thank you very much.
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,213,504
Messages
6,114,020
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top