====== pears.MasterRosterMakeDate ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create function "pears"."MasterRosterMakeDate"(
/* Application Maintained Function / Procedure - DO NOT EDIT*/
in "pstartdate" date,in "pdays" integer,in "pgedate" date )
returns date
deterministic
begin
if "pstartdate" is null or "pdays" is null or "pgedate" is null then
return null
end if;
set "pdays" = "abs"("pdays");
loop
if "pstartdate" >= "pgedate" then
return "pstartdate"
end if;
set "pstartdate" = "dateadd"("day","pdays","pstartdate")
end loop
end