So maybe someone can point me in the right direction of what causes this error? I struggled with this for several hours and searched the Internet, and I cannot understand what I am doing wrong here. It is included as part of the stored procedure, I do not know if it matters, if so, I can include this as well. The tables and field names have been changed to protect the innocent ... which means my job. Thank.
SELECT
FROM
WHERE
(Table.Field = stuff)
AND
(Table.Field2 = otherstuff)
AND
(Table2.Field3 = someotherstuff)
AND
CASE @param1
WHEN 0 THEN 'Table.Field IS NULL'
WHEN 1 THEN 'Table.Field2 IS NOT NULL'
ELSE ''
END
Thanks for answers. Technically, egrunin was the correct answer to this question, but OMG Ponies and Mark Byers were pretty much the same as without this last part. Thanks again.