all groups > sql server reporting services > december 2005 >
You're in the

sql server reporting services

group:

Group by Month/Week/Day in DateTime Field?


Group by Month/Week/Day in DateTime Field? Zean Smith
12/5/2005 10:34:37 AM
sql server reporting services:
Crystal Reports has the ability to group by datetime based on
month/week/daily basis in DateTime field. Can Reporting Server do this?



Re: Group by Month/Week/Day in DateTime Field? Zean Smith
12/5/2005 12:50:09 PM
I figured it out myself by using DataName and DatePart in SQL query:

SELECT DATENAME(mm, DateTime) + ', ' + CAST(DATENAME(yyyy, DateTime) AS
varchar(4)) AS MonthYearName, DATEPART(yyyy, DateTime) AS Year,
DATEPART(mm, DateTime) AS Month, *
FROM CorporateSales

Then, in Reporting Server, add the GROUP and then group the data by Month,
and by Year.
Add "MonthYearName" in header.
Add "Subtotal" in footer.

Bingo!!!



[quoted text, click to view]

AddThis Social Bookmark Button