pears.GetShiftLength

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

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
}
  • database/procedures/pears_getshiftlength.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1