Selasa, 14 April 2015

Re: [MS_AccessPros] Re: Using multiple name criteria to match

 



I made a demo consisting of three tables and one query.
 
The tables are:
Patrons, with fields PatronID, Fname, Sname
Voters, with fields VoterID, Fname, Sname
Nicknames, with fields NicknameID, FName, Nickname.
(Fname in Nicknames are all Fname's in Voters that have nicknames)
 
The query SQL is:
SELECT Patrons.PatronID, Patrons.Fname, Patrons.Sname, Voters.VoterID
FROM (Patrons LEFT JOIN Nicknames ON Patrons.Fname = Nicknames.Nickname) INNER JOIN Voters ON Patrons.Sname = Voters.Sname
WHERE (((Voters.Fname)=[Patrons].[Fname] Or (Voters.Fname)=[Nicknames].[FName]));
 
The query shows only Patrons that have matching Voter ID's

__._,_.___

Posted by: "Dave W" <davewi11@yahoo.co.uk>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

.

__,_._,___

Tidak ada komentar:

Posting Komentar