The formula below is a formula that calculates the time difference and it includes after midnight formula so we can report on how long a surgery was. The problem with the formula is that if the time difference is under 60 min. I get a 0 for the time difference. Do you have any suggestions as to how I can make this formula work? Or is there another one out there that is better?
Thanks.
If {v_CRA_or_pt_time_group.pt_time_outroom}>{v_CRA_or_pt_time_group.or_time_close}
Then ((Truncate({v_CRA_or_pt_time_group.pt_time_outroom}/100)*60)+
(ToNumber(Right(ToText({v_CRA_or_pt_time_group.pt_time_outroom}/100),2))))-
((Truncate({v_CRA_or_pt_time_group.or_time_close}/100)*60)+
(ToNumber(Right(ToText({v_CRA_or_pt_time_group.or_time_close}/100),2))))
ELSE
(1440-(Truncate({v_CRA_or_pt_time_group.or_time_close}/100)*60+
ToNumber(Right(ToText(({v_CRA_or_pt_time_group.or_time_close}/100)),2))))+
(Truncate({v_CRA_or_pt_time_group.pt_time_outroom}/100)*60+
ToNumber(Right(ToText(({v_CRA_or_pt_time_group.pt_time_outroom}/100)),2)))
Thanks.
If {v_CRA_or_pt_time_group.pt_time_outroom}>{v_CRA_or_pt_time_group.or_time_close}
Then ((Truncate({v_CRA_or_pt_time_group.pt_time_outroom}/100)*60)+
(ToNumber(Right(ToText({v_CRA_or_pt_time_group.pt_time_outroom}/100),2))))-
((Truncate({v_CRA_or_pt_time_group.or_time_close}/100)*60)+
(ToNumber(Right(ToText({v_CRA_or_pt_time_group.or_time_close}/100),2))))
ELSE
(1440-(Truncate({v_CRA_or_pt_time_group.or_time_close}/100)*60+
ToNumber(Right(ToText(({v_CRA_or_pt_time_group.or_time_close}/100)),2))))+
(Truncate({v_CRA_or_pt_time_group.pt_time_outroom}/100)*60+
ToNumber(Right(ToText(({v_CRA_or_pt_time_group.pt_time_outroom}/100)),2)))