You are combining a select query and an assignment query, not allowed!
You need to nest your case statements as you need to test the case for each record, variable assignment is a once only operation (using a cursor spit would allow you to do the record by record processing).
This example test the value of flag but note that it must know what to expect in the nested case, your ... cannot be a random date, it must be a testable value!
CASE Flag WHEN'FX'THENCASE Records WHEN0THEN'Failed'ELSE'Ok'ENDWHEN'MM'THENCASE Records WHEN0THEN'Failed'ELSE'Ok'ENDWHEN'TZ'THENCASE Records WHEN0THEN'Failed'ELSE'Ok'ENDENDFROM ProcessLog PL
Never underestimate the power of human stupidity
Last Visit: 31-Dec-99 18:00 Last Update: 28-Jul-17 7:58