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.safedate ====== <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"."safedate"( in "dd" char(30) ) returns char(30) begin declare "i" smallint; declare "t","d","m" char(20); if "dd" is null then return null end if; set "dd" = "replace"("dd",'T',' '); if "trim"("dd") = '' then return null end if; if "charindex"('/',"dd") = 0 then return "dd" end if; set "i" = "charindex"(' ',"dd"); if "i" > 0 then set "t" = "stuff"("dd",1,"i"-1,''); set "dd" = "left"("dd","i"-1) else set "t" = '' end if; set "i" = "charindex"('/',"dd"); set "d" = "left"("dd","i"-1); set "dd" = "stuff"("dd",1,"i",''); set "i" = "charindex"('/',"dd"); set "m" = "left"("dd","i"-1); set "dd" = "stuff"("dd",1,"i",''); return("string"("dd",'-',"m",'-',"d","t")) end </code> database/functions/pears_safedate.txt Last modified: 2026/08/07 19:24by 127.0.0.1