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

Syntax error in subquery

Status
Not open for further replies.

cr84net2

Programmer
Feb 8, 2005
93
US
I keep geting a syntax error near ')' error with the following:

Code:
sSqlWrk = "SELECT [wrestlername], [wrestlername] AS DispFld, [weightclass] FROM [wrestler]"
If lteam.wrestlername.CurrentValue = "" Or IsNull(lteam.wrestlername.CurrentValue) Then
sSqlWrk = sSqlWrk & " WHERE 0=1"
Else
sSqlWrk = sSqlWrk & " WHERE [wrestlername] = '" & ew_AdjustSql(lteam.wrestlername.CurrentValue) & "'"
sSqlWrk = sSqlWrk & " AND (NOT EXISTS (SELECT lteam.wrestlername FROM lteam WHERE wrestler.wrestlername = lteam.wrestlername AND lteam.ltID = " & lteam.ltID.ViewValue & "))"

I'm sure it is right in front of me but I keep getting the error near ')' , a syntax error or unterminated string constant error. Always at the end of the subquery. The results of this query feeds an array which in turn feeds a drop down box which eliminates choices as they are picked.

Any help would be appreciated as my brain has turned to mush.
 
Thanks,Frederico. So obvious. I thought I had already done that so I cussed you as I mumbled I'll do it again.. but I hadn't on this page and it reminded me to go back and double check that I had removed the debug on the other. I had so I haven't completely lost my mind yet. Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top