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 |
sanjay_jadam
Yak Posting Veteran
53 Posts |
Posted - 2006-01-09 : 08:35:16
|
Hi to all,I have created Matrix reportsMy result set of stored procedure is Name Date ValuesItem1 1/1/2004 10 Item1 2/1/2004 10 Item1 3/1/2004 10 Item1 1/1/2005 10 Item1 2/1/2005 10 i shown my report likeName in RowDate in ColumnValue in Detailsi want to calculate value according to yearmeans in 2004 value of item1 is 30and 2005 value is 20how can i do this?Please help me ASAP |
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-01-09 : 09:36:24
|
If ur requirement is a SQL Query:U can Use Group By along with Sum() and year() functions to get ur desired result.Please go thru the BOL and comeback if u want more help.I'll give u the logic (but u implement the query by modifying it)Select [Name], [Date], Sum([Value] ) from tbl Group by [Name], year([Date]) |
 |
|
|
|
|