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 |
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2012-06-06 : 08:58:40
|
dear alli have to create a query i need to calculate count of employees in every month inany body knowspls explain the logic |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2012-06-06 : 09:02:25
|
select convert(varchar(6),dte,112), count(*)from tblgroup by convert(varchar(6),dte,112)Depends on what your data looks like.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-06-07 : 22:59:26
|
[code]select year(datefield),month(datefield),count(*)from tablegroup by year(datefield),month(datefield) [/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|