September 11, 2008 at 12:54 pm
I need to run ay that give me this:
case
when C.ISIBCY='USD' then sum(amount) end as USD
when C.ISIBCY='EUR' then sum(amount) end as EUR
when C.ISIBCY='GBP' then sum(amount) end as GBP
it's not working, what AM I doing wrong??
thanks
September 11, 2008 at 2:32 pm
You can only have one "end as" command on a case statement. Split it into three case statements and you should be fine.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
September 11, 2008 at 7:11 pm
As usual G2 is right. Split into 3 cases and you have a nice neat return of 3 columns.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply