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 |
|
Agalo
Starting Member
1 Post |
Posted - 2009-04-25 : 07:13:17
|
| I have a table employee , containing following informationID Name Date Joined1 abc 4/31/20092 d 1/5/20093 e 6/3/20094 f 10/10/20085 g 4/16/20096 h 2/2/20097 j 7/19/2009I want result set which gives details of how many employee joined on monthly basis for a year. If user selects a date 6/20/2008 I want output to be begin from 6 month of 2008 to 5 month of 2009 i.e One year.I want total number of employees i.e cumulative sum , beginning from selected month.Required Output: If user selects 6/20/2008 JUN'08 JUL '08 ........ NOV '08 DEC '08 JAN '09 ..... APR '09 MAY '09 0 0 1 1 2 4 4 I am struggling with the query to get this output. I want only one sql query for doing this.Any help will be greatly appreciated.Thanks in advance. |
|
|
|
|
|