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.weekmonthenddate ====== <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> create function "pears"."weekmonthenddate"( /* 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") end if; set "rv" = "dateadd"("month",1+(select "monthoneoffset" from "params"),"ymd"("y","w",1))-1; return("rv") end </code> database/functions/pears_weekmonthenddate.txt Last modified: 2026/08/07 19:24by 127.0.0.1