brogrammer
brogrammer

Reputation: 21

SSRS Color Expression

I am trying to change the color of a bar chart column to yellow if it is the current month. For some reason, SSRS is not recognizing "Today()" or "Now()" as functions.

Basically what I'm trying to say is: =iif(month(Today()) = Month(Fields!CalendarYearMonth.Value), "Yellow", "#00000000"). I keep getting syntax errors under the () after today.

CalendarYearMonth is stored as "201308". I also have a CalendarMonthDesc field (August), or a CalendarMonth field which is (08).

Upvotes: 2

Views: 367

Answers (1)

Jamie F
Jamie F

Reputation: 23809

The Visual Studio editor is poor at recognizing proper expressions in the Expressions editor dialog. So I'd ignore the syntax squiggly.

Try this expression, which should force the needed conversion.

=iif(month(Today()) = System.Convert.ToInt32(Fields!CalendarMonth.Value), "Yellow", "#000000")

It looks like with your current expression you may have problems converting "201308" to the correct date as required by Month().

Upvotes: 2

Related Questions