Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have three tables in a query the

Status
Not open for further replies.

nike2000

Technical User
Apr 1, 2003
61
GB
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
 
You can request to have duplicate posts by clicking on "inapproproate post?"... This post is duplicated in
thread701-701363

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top