you need to have a calendar table for that. use the below function to generate one and do a left join with your tablehttp://visakhm.blogspot.com/2010/02/generating-calendar-table.htmlselect datepart(year,f.[Date])as 'YEAR', datepart(month,f.[Date])as 'MONTH',1 as 'Mapping',datename(month,f.[Date])as 'MonthName',count(t.QualificationRegistrationID) from dbo.CalendarTable(YourStartdate,YourENddate,0,0) fleft join [83.138.168.94].[Parnassus].[dbo].QualificationRegistration qualificationRegistration tON t.registrationDate = f.[Date]and qualificationRegistration.Deleted = 0and datepart(month,registrationDate) = DATEPART(month,getdate())and datepart(year,registrationDate) = DATEPART(year,getdate())group by datepart(year,f.[Date]),datepart(month,f.[Date]),datename(month,f.[Date])order by datepart(year,f.[Date]),datepart(month,f.[Date]),datename(month,f.[Date])
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/