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 |
|
Jabez
Starting Member
19 Posts |
Posted - 2007-04-26 : 04:30:06
|
| Hi Folks, Please help me in writing a query. I need to get current strength of employee's, monthwise (till each month).Table Structure----------------Employee_MasterED_EmpId ED_DOJ ED_Name-------- ------- --------- 2006-01-02 SRINIVASA 2006-01-02 KAVITA 2006-01-02 VIVEK 2006-02-20 CHANDRA 2006-02-25 PARIMAL 2006-02-30 SATISH ........ 2007-01-10 SANJEEV SHARMA 2007-01-14 JITENDRA PRATAP SINGH 2007-03-15 SANDEEP 2007-03-02 SUNIL KUMAR SHARMAI require the data in the below format.. For the year '2007-2008'Month Count----- -----April(07) 10May . 10June . 10 July . 10 August . 10Sept 10 Oct 10Nov 10Dec 10Jan (08) 10Feb . 10March . 10Thanks. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-04-26 : 04:32:51
|
| Something similar toSELECT DATENAME(year, ED_DOJ), DATENAME(month, ED_DOJ), count(*)FROM Employee_MasterGROUP BY DATENAME(year, ED_DOJ), DATENAME(month, ED_DOJ)Peter LarssonHelsingborg, Sweden |
 |
|
|
naveen901
Starting Member
2 Posts |
Posted - 2007-04-26 : 07:20:05
|
| Hi try thisselect datename(year,ed_doj),datename(month,ed_doj),count(*) from employee_master group by ed_dojperhaps this might help youthanksnaveen. |
 |
|
|
|
|
|
|
|