====== pears.weekmonthstartdate ====== 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"."weekmonthstartdate" IS {create function weekmonthstartdate /* Application Maintained Function / Procedure - DO NOT EDIT*/ (in perd integer,in worm char(1)) returns date begin declare rv date; declare w integer; declare y integer; set y=truncnum(perd,-2); set w=perd-y; set y=y/100; if worm = 'W' then return weekenddate(y,w)-6 end if; set rv=dateadd(Month,(select monthoneoffset from params),ymd(y,w,1)); return(rv) end }