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

Breaking line in sql 2

Status
Not open for further replies.

A1Pat

IS-IT--Management
Jun 7, 2004
454
0
0
US
Could someone help me to fix the breakdown line in this sql code. It's too long and the break I use is incorrected.

sql1 = "SELECT p1.Cat1ID, p1.Cat2ID, c1.Cat1Name, c2.Cat2Name _
FROM tblProducts AS p1, tblMainCat AS c1, tblCat2nd AS c2 _
WHERE p1.Cat1ID = c1.ID AND p1.Cat2ID = c2.ID AND Cat1Name = '" & request.querystring("maincat") & "'
 
You're missing quotation marks from the end of the lines
sql1 = "SELECT p1.Cat1ID, p1.Cat2ID, c1.Cat1Name, c2.Cat2Name" _
FROM tblProducts AS p1, tblMainCat AS c1, tblCat2nd AS c2" _
WHERE p1.Cat1ID = c1.ID AND p1.Cat2ID = c2.ID AND Cat1Name = '" & request.querystring("maincat") & "'"

 
are you sure GaryC123, b/c I did try that but I got an ERROR:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
 
sql1 = "SELECT p1.Cat1ID, p1.Cat2ID, c1.Cat1Name, c2.Cat2Name"& _
"FROM tblProducts AS p1, tblMainCat AS c1, tblCat2nd AS c2"& _
"WHERE p1.Cat1ID = c1.ID AND p1.Cat2ID = c2.ID AND Cat1Name = '" & request.querystring("maincat") & "'"
 
And from the beginning and &

sql1 = "SELECT p1.Cat1ID, p1.Cat2ID, c1.Cat1Name, c2.Cat2Name" & _
"FROM tblProducts AS p1, tblMainCat AS c1, tblCat2nd AS c2" & _
"WHERE p1.Cat1ID = c1.ID AND p1.Cat2ID = c2.ID AND Cat1Name = '" & request.querystring("maincat") & "'"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top