Last post Aug 14, 2015 03:50 AM by Krunal Parekh
Aug 12, 2015 12:09 PM|fadi hanna|LINK
i have a report that i should show dates in a table grouped by Year as parent group and then by month name as a child group
as shown in this screenshot :
i want to show months that are not shown between the arrows !!
how can i show all months from the min date till the end date
for ex: if the min date 12/5/2015 and the max 5/10/2015
how can i show in the parent child group 5|6|7|8|9|10 respectively even if there is no dates in any month
any help would be appreciated
Aug 14, 2015 03:50 AM|Krunal Parekh|LINK
Hello fadi hanna,
http://www.codeproject.com/Tips/767067/RDLC-Report-Grouping-with-Page-Break-Table-Header to learn how to do grouping .
as for month you can do something like this.
DECLARE @StartDate DATETIME,
SELECT @StartDate = '20110501'
,@EndDate = '20110801';
SELECT DATENAME(MONTH, DATEADD(MONTH, x.number, @StartDate)) AS MonthName
FROM master.dbo.spt_values x
WHERE x.type = 'P'
AND x.number <= DATEDIFF(MONTH, @StartDate, @EndDate);
Hope this helps.