Does the AND Statement after the OR statement have the same logic as something similar to
where d.res_id = 125 and t.task_type in( 'PPB', 'PPO')
and
d.status = ('C')
OR
d.status IN ('R' ,'D')
AND
t.done_dt = DATEADD(month, -1, GETDATE())
where d.res_id = 125 and t.task_type in( 'PPB', 'PPO')
IF d.status IN ('R','D')
t.done_dt = DATEADD(month, -1, GETDATE())
ELSE
d.status = 'C'
Which one is the correct way to format it?
I'm trying to display all d.status with the 'C' status. But only if the t.done_dt is the previous month, do I want to display d.status IN ('R', 'D')