问题
I'd like to grouping a column by a DateTime field (Months)
The values of this field are how this: 2014-12-16T12:56:06.32+01:00
How should be the expression to make a primary group by column?
Best regards
回答1:
You can use this query :
select SUBSTR(COLUMN_NAME,6,2) as "MONTH",count(*) from TABLE_NAME group by
substr(COLUMN_NAME,6,2);
You can add columns in group by as per requirement.
Note : Columns in group by should be present in select.
回答2:
Group by the record in SSRS design .
In the group by record column expression ,give following query
=MonthName(Month(Fields!ListingDate.Value))
来源:https://stackoverflow.com/questions/27617014/grouping-column-by-datetime