hi try this u want last six month data then:
select Left(DATENAME(Month,GETDATE()),3),SUM(empcount) from tablename
where dateoftransaction > dateadd (MONTH, -6, GETDATE())
Group by Left(DATENAME(Month,GETDATE()),3),MONTH(dateoftransaction) order by MONTH(dateoftransaction)
---------
please mark as answer or vote it if u find it helpful
vickey
No comments:
Post a Comment