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.NetOwnerDashboardDiaryCount ====== <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 procedure "pears"."NetOwnerDashboardDiaryCount"( in "pWebUserID" char(20) ) result( "todaysevents" char(5) ) begin select "COUNT"() as "todaysevents" from "diary" as "D" key join "staff" as "S" left outer join "iqxnetuser" as "U" where "U"."iqxnetuserid" = "pWebUserID" and "dateformat"("d"."diaryfrom",'yyyy-mm-dd') <= "dateformat"("NOW"(),'yyyy-mm-dd') and "dateformat"("d"."diaryto",'yyyy-mm-dd') >= "dateformat"("NOW"(),'yyyy-mm-dd') end /* DOC 2017-03-23 | counts the number of events for today */ go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetOwnerDashboardDiaryCount" IS {create PROCEDURE pears."NetOwnerDashboardDiaryCount"(in pWebUserID char(20)) RESULT(todaysevents char(5)) BEGIN SELECT COUNT(*) as todaysevents FROM diary D KEY JOIN staff S LEFT JOIN iqxnetuser U WHERE U.iqxnetuserid=pWebUserID AND dateformat(d.diaryfrom, 'yyyy-mm-dd') <= dateformat(NOW(), 'yyyy-mm-dd') AND dateformat(d.diaryto, 'yyyy-mm-dd') >= dateformat(NOW(), 'yyyy-mm-dd') END /* DOC 2017-03-23 | counts the number of events for today */ } </code> database/procedures/pears_netownerdashboarddiarycount.txt Last modified: 2026/08/07 19:24by 127.0.0.1