Please start any new threads on our new
site at http://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Our new SQL Server Forums are live!
Come on over! We've restricted the ability to create new threads on these forums.
Constraint Violating Yak Guru
Very Important crosS Applying yaK Herder
Total*100.0/SUM(Total) OVER (PARTITION BY [Month]) AS [Total%]
Flowing Fount of Yak Knowledge
WHEN Title = 'A' THEN
100.0*Total/SUM(CASE WHEN Title=B THEN Total ELSE 0 END) OVER(PARTITION BY MONTH)
quote:Originally posted by peaceI tried James method but the result I get 0.visakh16 method the total are incorrect.
CASE WHEN Title='A' THEN Total*100.0/SUM(CASE WHEN Title='B' THEN Total ELSE 0 END) OVER (PARTITION BY [Month]) ELSE Total END AS [Total]