Link to home
Start Free TrialLog in
Avatar of zimmer9
zimmer9Flag for United States of America

asked on

I am having an issue with a SQL Statement WHERE Clause in SQL Server 2008, I get the message "incorrect syntax near '=' ?

I am using SQL Server 2008 and I suspect I need to replace part of my SQL Statement WHERE clause:

WHERE StopVoidPay.userid = tbl_CSL_users.msidOld))= False))
with
WHERE StopVoidPay.userid != tbl_CSL_users.msidOld))

but I get confused with the placement of opening and closing parenthesis as follows:

SELECT
bank.entity,
tbl_CSL_StopVoidPay.bank,
tbl_CSL_StopVoidPay.userid,
tbl_CSL_StopVoidPay.dtCreated,
tbl_CSL_StopVoidPay.chkNum,
tbl_CSL_StopVoidPay.branch,
tbl_CSL_StopVoidPay.chkDt,
tbl_CSL_StopVoidPay.accountNum,
tbl_CSL_StopVoidPay.amount,
tbl_CSL_StopVoidPay.typeSV
FROM tbl_CSL_bank INNER JOIN tbl_CSL_StopVoidPay ON tbl_CSL_bank.bankID = tbl_CSL_StopVoidPay.bank
WHERE (((tbl_CSL_StopVoidPay.typeSV)='S') AND
((Exists (SELECT msidOld
FROM tbl_CSL_users
WHERE StopVoidPay.userid = tbl_CSL_users.msidOld))= False))   <---- Line 16
ORDER BY StopVoidPay.chkNum;

Msg 102, Level 15, State 1, Line 16
Incorrect syntax near '='.

Do you know how I can resolve this?
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial