Incorrect syntax near '='
Posted on 2011-10-06
Preface: I am new to SQL and Crystal Reports both, so this may have an easy answer I can't find.
I have been trying to run the following code in MSN SQL Server 2008 and as a SQL expression in Crystal Reports XI 2:
WHERE "JobCode" IN (SELECT "JobCode" FROM Invoices)
AND "Status" IN (SELECT "Status" FROM Invoices) = 4
I get the error message "Incorrect syntax near '=' ".
I tried substituting IS NOT NULL for the = 4, then got the error message Incorrect syntax near 'IS' . With this code, I am trying to rewrite the following code from a Crystal Reports report, which comes up with the error message "Reserved error (|); there is no message for this error."
from Invoices a
where jobs.jobcode = a.JobCode
and a.status = 4)
Any and all help greatly appreciated.