I'm writing a code where I want to query the database to update instances of a log to reflect the final status of the project. For example:

would be translated to:
My code so far is:
SELECT a.ID, a.date, a.eval_group,
CASE WHEN a.date > b.date
AND eval_group = ('completed' OR 'canceled')
THEN
b.eval_group
ELSE
a.eval group
END AS new_eval_group
FROM temp as a
JOIN temp as b
ON a.ID = b.ID
I'm not sure how to proceed from here and would appreciate any direction. I'm not used to SQL and do not know how to make this function work within the language!
AND eval_group IN ('completed', 'canceled')in the case expression.