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.MasterRosterStartDate ====== <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"."MasterRosterStartDate" IS {create function MasterRosterStartDate /* Application Maintained Function / Procedure - DO NOT EDIT*/ ( in MRID char(20),in VacID char(20) ) returns char(20) begin declare MaxDays integer; declare SDate date; if isnull(MRID,'') = '' then select Max(daysincycle) into MaxDays from Masterroster where VacancyID = VacID; select Min(startdate) into SDate from Masterroster where VacancyID = VacID and daysincycle = MaxDays else select daysincycle,startdate into MaxDays,SDate from Masterroster where MasterRosterID = MRID end if; if SDate <= current date then while current date not between Sdate and Sdate+MaxDays loop set SDate = SDate+MaxDays end loop end if; return dateFormat(SDate,'yyyy-mm-dd') end } </code> database/procedures/pears_masterrosterstartdate.txt Last modified: 2026/08/07 19:24by 127.0.0.1