Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.GetWorkPatternWeeklyHours ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."GetWorkPatternWeeklyHours" IS {create function GetWorkPatternWeeklyHours /* Application Maintained Function / Procedure - DO NOT EDIT*/ (in placid char(20), in pstartdate date, in penddate date) returns double begin declare Absense Integer; declare Hours Double; declare Days Integer; declare WeekHours Double; select (select count(state) from TempShift where shiftdate between pStartDate and pEndDate and tempshift.state in ('H','U') and tempshift.personid = employment.personid) as Absense, Placement.WorkNormalHours as Hours, (isnull(Placement.WorkMonday,0) + isnull(Placement.WorkTuesday,0) + isnull(Placement.WorkWednesday,0) + isnull(Placement.WorkThursday,0) + isnull(Placement.WorkFriday,0) + isnull(Placement.WorkSaturday,0) + isnull(Placement.WorkSunday,0) ) - Absense as Days, (if Days > 0 then Days * Hours else 0 endif) as WeekHours into Absense, Hours, Days, WeekHours from placement key join employment where placementid = placid; return isnull(weekhours,0); end } </code> database/procedures/pears_getworkpatternweeklyhours.txt Last modified: 2026/08/07 19:24by 127.0.0.1