====== pears.GetShiftLength ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Original SQL ===== COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."GetShiftLength" IS {create function 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 }