AND and AND and AND! (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


yogaboy -> AND and AND and AND! (11/10/2004 16:25:04)

Does anyone know how I can make a statement with 2 ANDs?

I have this

mySQL = "SELECT KeyDocuments.DocTitle, Regions.RegionName FROM KeyDocuments, Regions WHERE (KeyDocuments.RegionID='" & RegionSelected & "') AND (KeyDocuments.RegionID=Regions.RegionID)"

and I want this (or the equivalent that works)

mySQL = "SELECT KeyDocuments.DocTitle, Regions.RegionName FROM KeyDocuments, Regions WHERE (KeyDocuments.RegionID='" & RegionSelected & "') AND (KeyDocuments.RegionID=Regions.RegionID) AND KeyDocuments.WebsiteSection='News'"

Any ideas???





BeTheBall -> RE: AND and AND and AND! (11/10/2004 17:22:16)

Does this work?

mySQL = "SELECT KeyDocuments.DocTitle, Regions.RegionName FROM KeyDocuments INNER JOIN Regions ON KeyDocuments.RegionID=Regions.RegionID WHERE (KeyDocuments.RegionID='" & RegionSelected & "' AND KeyDocuments.WebsiteSection='News')"




yogaboy -> RE: AND and AND and AND! (11/11/2004 7:31:39)

It did work - thanks a lot Duane.[:)]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875