Breaks down credits applied to services in a date range by type and groups by payor type.
Select
payortype,
Credtype,
count(distinct cre_jnum) as "Number",
sum(crsplamt) as "Paid"
From
sos.rv_creditsplits
Where
srv_date between '2001-01-01' and '2001-01-31'
and systranflag not in ('TT','TF')
group by
credtype,
payortype