I have three tables in a query the SQL is:
SELECT
Tbl_Trades.[MAD No],
Tbl_Trades.[FRD No],
Tbl_Trades.[Analytic Direction],
Tbl_Trades.Ptf,
Tbl_PortfolioLocations2C.Location,
Tbl_Trades.[Portfolio 2],
Tbl_PortfolioLocations2C_1.Location
FROM Tbl_PortfolioLocations2C AS Tbl_PortfolioLocations2C_1 INNER JOIN (Tbl_Trades INNER JOIN Tbl_PortfolioLocations2C ON Tbl_Trades.Ptf = Tbl_PortfolioLocations2C.Ptf) ON Tbl_PortfolioLocations2C_1.Ptf = Tbl_Trades.[Portfolio 2]
GROUP BY
Tbl_Trades.[MAD No],
Tbl_Trades.[FRD No],
Tbl_Trades.[Analytic Direction],
Tbl_Trades.Ptf,
Tbl_PortfolioLocations2C.Location,
Tbl_Trades.[Portfolio 2],
Tbl_PortfolioLocations2C_1.Location;
=====================================================
For the fields Location (it appears in two Tables; Tbl_PortfolioLocations2C and Tbl_PortfolioLocations2C_1) I would like it to only show the records where London appears in either of the two fields, not if it appears in both.
How can this be written??
Thanks,
Nike
SELECT
Tbl_Trades.[MAD No],
Tbl_Trades.[FRD No],
Tbl_Trades.[Analytic Direction],
Tbl_Trades.Ptf,
Tbl_PortfolioLocations2C.Location,
Tbl_Trades.[Portfolio 2],
Tbl_PortfolioLocations2C_1.Location
FROM Tbl_PortfolioLocations2C AS Tbl_PortfolioLocations2C_1 INNER JOIN (Tbl_Trades INNER JOIN Tbl_PortfolioLocations2C ON Tbl_Trades.Ptf = Tbl_PortfolioLocations2C.Ptf) ON Tbl_PortfolioLocations2C_1.Ptf = Tbl_Trades.[Portfolio 2]
GROUP BY
Tbl_Trades.[MAD No],
Tbl_Trades.[FRD No],
Tbl_Trades.[Analytic Direction],
Tbl_Trades.Ptf,
Tbl_PortfolioLocations2C.Location,
Tbl_Trades.[Portfolio 2],
Tbl_PortfolioLocations2C_1.Location;
=====================================================
For the fields Location (it appears in two Tables; Tbl_PortfolioLocations2C and Tbl_PortfolioLocations2C_1) I would like it to only show the records where London appears in either of the two fields, not if it appears in both.
How can this be written??
Thanks,
Nike