Re: Quick, simple crosstab question

From: Carl Imthurn (nospam_at_all.com)
Date: 11/12/04


Date: Fri, 12 Nov 2004 09:51:32 -0800

Thank you Adam. That did it!
Somehow, I feel like I should have been able to figure that out by myself, but now I know
for next time, and I appreciate your time and expertise. Have a great day.

Carl

Adam Machanic wrote:

> Thanks for posting DDL and sample data! Makes questions very easy to
> answer...
>
> This will do what you need:
>
>
> select office_num,
> sum(case when CurrentBalance > 0 then CurrentBalance else 0 end) as
> TotalDebitBalances,
> sum(case when CurrentBalance < 0 then CurrentBalance else 0 end) as
> TotalCreditBalances
>