Hi everyone,
I have a report with Period field that I use on a graph as Category
field (horozontal axe.) I want to group on the month part of the
Period. In my sql query Period is DATETIME. I found a similar topic
here and used this expession to group on month:
=DatePart("MM", Fields!Period.Value)
I also sorted by Period to preserve date-order.
I am getting the following error in preview:
The group expression for the grouping 'chart1_CategoryGroup1' contains
an error: Argument "Interval" is not a valid value.
Here is a format of my Period as it comes from SQL Server:
2004-02-29 00:00:00.000
Any ideas what is wrong?
Thanks in advance!
StanI just found my problem.
this
=DatePart("MM", Fields!Period.Value) shoild be like that:
=DatePart("M", Fields!Period.Value)
One single m!
Stan|||There is another problem. My data runs from February, 2004 to October,
2005. When I group on month my graph shows only 12 months. I don't see
data from the mid-end 2005!!! Is this s bug or a feature of RS'
Stan|||You need to group on the combination of year and month - otherwise data
from both Feb 2004 and Feb 2005 will be grouped together (and similarly
for other months, of course).
Something like =DatePart("yyyy", Fields!Period.Value) & " " &
DatePart("m", Fields!Period.Value)
You may need to convert this to a string, with a leading zero for the
month, for it to work correctly.|||Thanks! I did just that. In Group On expression for the Period in my
graph I entered:
=Year(Fields!Period.Value)*100 + Month(Fields!Period.Value)
so that I group on a combination of year and month.
Stan
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment