Grouping by First_of_Month
Hi, I've created a matrix style table in report builder. The one problem I'm running into is the columns are broken out by days of the month and I just want the data to aggregate to first_of_month. So, the example is that there are a lot of counts for the month of july but instead of having the columns say july1, july2, july3 etc...I want the data to consolidate under 7-1-2011, and 8-1-2011 in the table columns, and so on until my date range ends. Anyone try this before?
May 26th, 2011 9:45am

Hi, Suppose you have a date column in your select statement: MyTable.MyDate, then modify it by adding CAST(STR(Month(MyTable.MyDate)) + '/1/' + STR(YEAR(MyTable.MyDate)) as datetime) as DateForGrouping Use DateForGrouping in your report column group. Remember to mark as an answer if this post has helped you.
Free Windows Admin Tool Kit Click here and download it now
May 26th, 2011 1:00pm

It is possible to do via T-SQL, please provide sample data and desired resultBest Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
May 26th, 2011 2:12pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics