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
 Transact-SQL (2000)
 How to group by using month field

Author  Topic 

xman
Starting Member

3 Posts

Posted - 2006-05-30 : 06:54:52
I use a sq query to group by some record for month field. I use "group by month(fieldnae)". Only one problem is if there is no record for a month say may i want to show one row containing 0.

Can any one tell me the answer.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-05-30 : 07:16:57
Have a number table with 1 to 12 and left join with other table

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -