I have a column in my view named Duration defined as following.
CASE WHEN Shift_From_Hour IS NULL OR Shift_To_Hour IS NULL THEN 0 WHEN Shift_From_Hour < 0 OR Shift_From_Hour > 24 OR Shift_From_Minute < 0 OR Shift_From_Minute > 59 THEN 0 WHEN Shift_To_Hour < 0 OR Shift_To_Hour > 24 OR Shift_To_Minute < 0 OR Shift_To_Minute > 59 THEN 0 WHEN Shift_From_Hour > Shift_To_Hour THEN ((24 - Shift_From_Hour) + Shift_To_Hour) * 60 + (Shift_To_Minute - Shift_From_Minute) ELSE (Shift_To_Hour - Shift_From_Hour) * 60 + (Shift_To_Minute - Shift_From_Minute) END
Now would like to add a new field to my view named Duration2 having the following logic.
(Code taken from Access query).
Meaning if the duration column is 0 it should return 1440/60, otherwise return the results of Duration column divided by 60.