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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Date question

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-11 : 08:09:02
Steve writes "Hi,

I have a table that has a date column, I would like to be able to see the data in a month column view.
e.g table at present is date column, value column

I want to group the date column in months and then sum the value underneath the month. e.g.

Jan Feb Mar
100 200 150 etc

How would this be possible? it would also need to work across years so it must take into account leap years.

Many thanks for all your help and ideas in advance

cheers

Steve"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-03-11 : 08:09:26
It sounds like you want a cross tab:

http://www.sqlteam.com/searchresults.asp?SearchTerms=cross+tab
Go to Top of Page
   

- Advertisement -