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 |
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-08-20 : 13:47:54
|
DATE TOTAL how to convert 2014-01-01 3 2014 -01- 02 4 2014-01-02 5 2014-02-01 5 2014 -02- 02 8 2014-02-02 7 to(BASICALLY DO A COUNT FOR EACH MONTH)JAN 2104 12 --- Jan totalFEB 2014 20 --- FEB total |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-08-20 : 13:54:37
|
What data type is the date column?Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-08-20 : 14:06:04
|
date |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-08-20 : 14:23:29
|
select DATEADD(MONTH, DATEDIFF(MONTH, 0,datecol), 0), sum(total)from @tgroup by DATEADD(MONTH, DATEDIFF(MONTH, 0,datecol), 0)Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|