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

vba SQL question

Status
Not open for further replies.

Palmyra

Programmer
Jan 5, 2007
150
US
I have the following SQL in some vba. I can't seem to figure out the syntax to get the right parenthesis for the subquery. Cany ideas?

strsql = "SELECT wall.wclient " & _
"FROM wall " & _
"INNER JOIN client " & _
"ON wall.wclient = client.clnum " & _
"WHERE wall.wpartype = 'c' and clnum IN " & _
"(SELECT LEFT(fmatter,5) FROM folder
WHERE fbarcode = " & " '" & glsFolder & "'"

Thanks.
 
strsql = "SELECT wall.wclient " & _
"FROM wall " & _
"INNER JOIN client " & _
"ON wall.wclient = client.clnum " & _
"WHERE wall.wpartype = 'c' and clnum IN " & _
"(SELECT LEFT(fmatter,5) FROM folder
WHERE fbarcode = " & " '" & glsFolder & "')"
 
add

debug.print strsql

and you will probably see the problem...

Right off hand I see you are missing a ")" at the end.

Simi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top