sum(case when gifttype in ('b','g','y') then giftjntamt else 0 end)as Gifts,
sum(case when gifttype = 'c' then giftjntamt else 0 end)as Credits
sample output
Gifts Credits
25 0
55 25
250 100
I know want to get a total of the gifts and credits and show it in a separate column. I then want to use the grand total and say that if the grand total is less than 250, suppress it
--sum(Gifts)+(Credits) as GrandTotal
sum(case when gifttype = 'c' then giftjntamt else 0 end)as Credits
sample output
Gifts Credits
25 0
55 25
250 100
I know want to get a total of the gifts and credits and show it in a separate column. I then want to use the grand total and say that if the grand total is less than 250, suppress it
--sum(Gifts)+(Credits) as GrandTotal