Re: Quick, simple crosstab question
From: Carl Imthurn (nospam_at_all.com)
Date: 11/12/04
- Next message: Ram Kumar Koditala: "Re: What is the wrong with this SQL?"
- Previous message: Chris Marsh: "Re: Logging deletes..."
- In reply to: Adam Machanic: "Re: Quick, simple crosstab question"
- Messages sorted by: [ date ] [ thread ]
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
>
- Next message: Ram Kumar Koditala: "Re: What is the wrong with this SQL?"
- Previous message: Chris Marsh: "Re: Logging deletes..."
- In reply to: Adam Machanic: "Re: Quick, simple crosstab question"
- Messages sorted by: [ date ] [ thread ]