Query returns unwanted blank records

  • Thread starter Thread starter mabyn
  • Start date Start date
M

mabyn

Following is the SQL for a query that has four tables. The last two fields
are not populating with the data from their respective tables. I don't know
what I am doing incorrectly. Can someone assist me?

SELECT Attendees.AttendeeFirstName, Attendees.AttendeeLastName,
Attendees.CompanyName, Registration.[Entry Name], Registration.EventID,
ShamrockRatingPossible.ShamrockRating,
ShamrockRatingMarshalComments.MarshallComments
FROM ShamrockRatingPossible RIGHT JOIN (ShamrockRatingMarshalComments RIGHT
JOIN (Attendees RIGHT JOIN Registration ON Attendees.AttendeeID =
Registration.AttendeeID) ON ShamrockRatingMarshalComments.MarshalCommentsID =
Registration.ShamrocksGottenID) ON ShamrockRatingPossible.ShamrockRatingID =
Registration.ShamrockRatingID;
 
My original SQL had INNER JOIN like:
SELECT Attendees.AttendeeFirstName, Attendees.AttendeeLastName,
Attendees.CompanyName, Registration.[Entry Name], Registration.EventID,
ShamrockRatingPossible.ShamrockRating,
ShamrockRatingMarshalComments.MarshallComments
FROM ShamrockRatingMarshalComments INNER JOIN (ShamrockRatingPossible INNER
JOIN (Attendees INNER JOIN Registration ON Attendees.AttendeeID =
Registration.AttendeeID) ON ShamrockRatingPossible.ShamrockRatingID =
Registration.ShamrockRatingID) ON
ShamrockRatingMarshalComments.MarshalCommentsID =
Registration.MarshalCommentsID;

However, no data shows up when I use that...so I tried LEFT JOIN and that
didn't work so I used RIGHT JOIN.
--
Mabyn


KARL DEWEY said:
Seems to me your joins are wrong. Try building them in design view.


mabyn said:
Following is the SQL for a query that has four tables. The last two fields
are not populating with the data from their respective tables. I don't know
what I am doing incorrectly. Can someone assist me?

SELECT Attendees.AttendeeFirstName, Attendees.AttendeeLastName,
Attendees.CompanyName, Registration.[Entry Name], Registration.EventID,
ShamrockRatingPossible.ShamrockRating,
ShamrockRatingMarshalComments.MarshallComments
FROM ShamrockRatingPossible RIGHT JOIN (ShamrockRatingMarshalComments RIGHT
JOIN (Attendees RIGHT JOIN Registration ON Attendees.AttendeeID =
Registration.AttendeeID) ON ShamrockRatingMarshalComments.MarshalCommentsID =
Registration.ShamrocksGottenID) ON ShamrockRatingPossible.ShamrockRatingID =
Registration.ShamrockRatingID;
 
Back
Top