Skip to content

Commit b14ff18

Browse files
committed
Stored Procedure
1 parent 52b9eda commit b14ff18

4 files changed

+20
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
DROP PROCEDURE if Exists dashMembership;
2+
Create PROCEDURE dashMembership()
3+
SELECT sum(if(`Inactive?` = false, 1, 0)) as 'Active', sum(if(`Inactive?` = true, 1, 0)) as 'Inactive'
4+
From Organizations;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Drop PROCEDURE if exists dashBudgetAlloc;
2+
Create PROCEDURE dashBudgetAlloc(IN FY integer(2))
3+
SELECT concat('$', format(sum(`Amount Proposed` + `Approved Appeal`), 2)) as 'Total Budget'
4+
FROM Budgets
5+
WHERE `Fiscal Year` like concat('%', FY, '%');
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Drop PROCEDURE if exists dashFRAllocation;
2+
Create PROCEDURE dashFRAllocation(IN FY integer(2))
3+
SELECT concat('$', format(sum(If(Status = 'Approved', FRF.`Approved Amount`, `Amount Approved`)), 2)) as 'Total FR'
4+
From `Funding Requests`
5+
LEFT JOIN FRReportForms FRF on `Funding Requests`.ID = FRF.FR_ID
6+
Where `Fiscal Year` like concat('%', FY, '%');
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
DROP PROCEDURE if exists dashMTAllocation;
2+
CREATE PROCEDURE dashMTAllocation(IN FY integer(2))
3+
SELECT concat('$', format(sum(`Amount Approved`), 2)) as 'Total MT'
4+
From `Mandatory Transfers`
5+
Where `Fiscal Year` like concat('%', FY, '%');

0 commit comments

Comments
 (0)