SQL Help

Forums:

I am using the custom Fee transactions report (and it is on and html page)however I have added one more tlist to it as we needed to also have a breakdown by Fee Type so here is my sql statement.
SELECT ft.payment_method,
count(ft.payment_method) totalcount,
sum(ft.amount) totalamount

FROM Fee_Transaction ft

WHERE ~[if.~[gpv:date]=]ft.date_value = '~[eaodate]'[else]ft.date_value = '~[gpv:date]'[/if]
AND ft.schoolid = ~(curschoolid)
AND ft.transaction_type = 'Payment'

GROUP BY ft.payment_method

ORDER BY lower(ft.payment_method);alternatecolor]

~(ft.payment_method;t)
~(totalcount;l)
$ ~(totalamount;r;format=#,##,###.00)

What i need is the sum(ft.amont) totalamount to also have a formula that subtracts any Transaction types of Credit from the fee type amount. Is this possible?

Subscribe to Comments for "SQL Help"