Approved Workman Database

Community Contributions => SQL Workbench => Topic started by: Sherri on February 18, 2010, 01:18:41 PM

Title: Getting the total cost of items waived
Post by: Sherri on February 18, 2010, 01:18:41 PM
I wanted to see how much we had to pay for items ordered from Awana out of our budget (as opposed to items getting reimbursed by parents).  In other words, I wanted the total of items waived, not including dues.  Since the Ledger's Fees grid did not have a way to show partial payments that were waived, I used the following sql query:

select Sum(FP.Amount) as Total from Payment P, Fee F, Fee_Payment FP
where P.Type = 'Waived' and F.For_Dues = False and P.Payment_ID = FP.Payment_ID and FP.Fee_ID = F.Fee_ID and F.Club_Year = '2009-2010'

See the following thread for more details: http://approvedworkman.com/forum/index.php?topic=826 (http://approvedworkman.com/forum/index.php?topic=826)