I have two tables, TblCompetitor and TblClass/Peters.
TblCompetitor has 93 records, one for each competitor for the current year. TblClass/Peters lists all competitors for the past four years, thus many of the names have an entry for more than one year.
Using the names and initials from TblCompetitor (to eliminate two people with the same name) I want to extract all records for each name which appear in TblsClass/Peters.
E.g. Draper J. is competing in the current year but has also competed in 2002, 2003 and 2004. Therefore, the query should return three records from TblClass/Peters against the name and initials in TblCompetitor
I have created the following query but, no matter how I adjust the joins, I cannot retrieve more than one record from TblClass/Peters for each name in TblCompetitor.
Can anyone please advise me where I am going wrong.
Best Regards
John
TblCompetitor has 93 records, one for each competitor for the current year. TblClass/Peters lists all competitors for the past four years, thus many of the names have an entry for more than one year.
Using the names and initials from TblCompetitor (to eliminate two people with the same name) I want to extract all records for each name which appear in TblsClass/Peters.
E.g. Draper J. is competing in the current year but has also competed in 2002, 2003 and 2004. Therefore, the query should return three records from TblClass/Peters against the name and initials in TblCompetitor
I have created the following query but, no matter how I adjust the joins, I cannot retrieve more than one record from TblClass/Peters for each name in TblCompetitor.
Code:
SELECT TblCompetitor.TxtName, TblCompetitor.TxtInitials, [TblClass/Peters].TxtName, [TblClass/Peters].TxtInitials, [TblClass/Peters].TxtRank_Rating, [TblClass/Peters].TxtUnit, [TblClass/Peters].TxtClass, [TblClass/Peters].fPetersPrize, [TblClass/Peters].fWonPeters, [TblClass/Peters].fISTeam, [TblClass/Peters].TxtYear
FROM TblCompetitor LEFT JOIN [TblClass/Peters] ON (TblCompetitor.TxtName = [TblClass/Peters].TxtName) AND (TblCompetitor.TxtInitials = [TblClass/Peters].TxtInitials)
WHERE (((TblCompetitor.TxtName) Is Not Null))
ORDER BY TblCompetitor.TxtName;
Can anyone please advise me where I am going wrong.
Best Regards
John