====== pears.GetShiftLength ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Original SQL ===== create function "pears"."GetShiftLength"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in @TimeFrom time,in @TimeTo time, in @BreakMinutes smallint default 0 ) returns double begin declare "ShiftLength" double; if @TimeTo > @TimeFrom then set "ShiftLength" = (cast("datediff"("minute",@TimeFrom,@TimeTo) as double)-"isnull"(@BreakMinutes,0))/60.0 else set "ShiftLength" = (cast("datediff"("minute",@TimeFrom,'00:00:00') as double)+1440.0+cast("datediff"("minute",'00:00:00',@TimeTo) as double)-"isnull"(@BreakMinutes,0))/60.0 end if; return "ShiftLength" end