|
Posted by --CELKO-- on 10/13/06 14:16
There is no CASE statement in SQL; there is a CASE expression.
Expressions return values. There is no BOOLEAN data type in SQL.
Fields are not anything like columns. Your entire mental model of SQL
is wrong and you are trying to make it work like a procedural language
that you already know.
Also, we prefer to follow ISO-11179 rules for data elements names, so
quit putting that silly, redundant "tbl-" on table names (unless
furniture is actually involved) and start using collective or plural
names (unless the table is not a set or class of entities, but a single
item).
Here is a guess at what you wanted
WHERE ( COALESCE (@my_company , Clients.company_code) = 933
OR Cases.clientcode = @my_client)
AND Case.foobar_status = 'Active' -- status is too vague
Navigation:
[Reply to this message]
|