In a query I have a calculated field that is based on several criterias to be matched at the same time.
IF progress = 0
IF start<now() AND end>now() THEN "delay"
IF start<now() AND end<now() THEN "overdue"
IF progress BETWEEN 0 AND 1
IF start<now() THEN "advanced"
IF end<now() THEN "overdue"
IF end>now() AND end*progress>=now() THEN "in progress"
IF end>now() AND end*progress<now() THEN "delayed"
IF progress=1 THEN "completed"
I am looking at how to set this set of conditions performance-wise. Should I change the outer IF (the one about the progress field) to a CASE?