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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm trying to get working this sql

Status
Not open for further replies.

anto

Technical User
Aug 2, 2000
7
IT
I'm trying to get working this sql query generated from Access,
in a MySQL database. Mysql stop at the first left join, so I presume there's something wrong in left join syntax and in the use of parenthesis.
Any suggestion? B.T.W. sorry for the awful long query that follows.
thanks


SELECT Categorie.CatMerIt, Fiere.NomeFiera, Nazioni.Nazione, Comuni.CitIt, Fiere.DataInizio, Fiere.DataFine, Prodotti.Prodotto
FROM (((Categorie LEFT JOIN (LNK_CatFie LEFT JOIN Fiere ON LNK_CatFie.RifFie = Fiere.ID_Fiera) ON Categorie.IDCatMer = LNK_CatFie.RifCatMer) LEFT JOIN Nazioni ON Fiere.ID_Paese = Nazioni.ID_Nazione) LEFT JOIN Comuni ON Fiere.ID_Comune = Comuni.KeyCit) LEFT JOIN Prodotti ON Fiere.ID_Prodotti = Prodotti.ID_prodotto
WHERE (((Categorie.CatMerIt)=&quot;$Category&quot;) AND ((Fiere.NomeFiera)=&quot;$NomeFiera&quot;) AND ((Nazioni.Nazione)=&quot;$Nazione&quot;) AND ((Comuni.CitIt)=&quot;$Comune&quot;) AND ((Fiere.DataInizio)>=&quot;$DataInizio&quot;) AND ((Fiere.DataFine)<=&quot;$DataFine&quot;)) OR (((Categorie.CatMerIt)=&quot;$Category1&quot;)) OR (((Categorie.CatMerIt)=&quot;$Category2&quot;))
ORDER BY Fiere.NomeFiera;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top