Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-08-08 : 07:36:48
|
Craig writes "Hi allI found this article, http://www.sqlteam.com/item.asp?ItemID=2955, and it works like a charm, until I start to use multiple calculations (eg1) within the pivot when it fails dramatically.I thought the syntax of the calculation was incorrect, but when I break it down to the individual parts (eg2/eg3), the execute works.Does anyone know how to overcome this.eg1'100*sum(CASE WHEN DaysOD IS NOT NULL AND DaysOD <= tblDefStd.DefStd THEN 1 ELSE 0 END) / sum(CASE WHEN DateClosed IS NOT NULL THEN 1 ELSE 0 END)', ' Month(DateRaised) ', 'tblDefect'eg2 '100*sum(CASE WHEN DaysOD IS NOT NULL AND DaysOD <= tblDefStd.DefStd THEN 1 ELSE 0 END)', ' Month(DateRaised) ', 'tblDefect'eg3 '100*sum(CASE WHEN DateClosed IS NOT NULL THEN 1 ELSE 0 END)', ' Month(DateRaised) ', 'tblDefect'" |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|