Hi,
Here is the sample of my data:
Table Name: test_result
Fields: person_id code_iddate_completed
Dataid1123
Id145601/21/2011
Id1666
Since the first record meets condition: code_id = ‘123’ and no completed date, then this patient’s status should be Y....