select day(Date) as 'Day', count(*) as 'number of days', CONVERT(char(7), date, 120) As [year] from [dbo].[Expenses] where Day(date) is not null group by day(Date),CONVERT(char(7), date, 120)
SELECT DATENAME(MONTH, MONTH([Date])) AS ForMonth ,COUNT(*) AS NumberOfDays ,YEAR([Date]) AS ForYear FROM [dbo].[Expenses] where [Date] IS NOT NULL GROUP BY YEAR([Date]), MONTH([Date]);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)