I have a data set that I am trying to force everything >12 months ago into a single group. I am trying to do this with a SQL case when that assigns all months and year >12 months ago a int value of 0 but when I try to put this into SSRS it doesnt work.
I have been trying to use this formula but it does not work unless I remove the 'MonthName' function.
=iif(Fields!ASGN_SUB_DUE_MONTH.Value > 0,monthname(Fields!ASGN_SUB_DUE_MONTH.Value) & " " & Fields!ASGN_SUB_DUE_YEAR.Value
,"More than 12 months ago")
But this formula works
=iif(Fields!ASGN_SUB_DUE_MONTH.Value > 0,
monthname(iif(Fields!ASGN_SUB_DUE_MONTH.Value > 0 and Fields!ASGN_SUB_DUE_MONTH.Value < 13, Fields!ASGN_SUB_DUE_MONTH.Value,1))
& " " & Fields!ASGN_SUB_DUE_YEAR.Value
,"More than 12 months ago")
Does anyone know why and how I can resolve. The second function works but I'm not comfortable leaving it in the reporting incase the second part of the imbedded iif ever functions.
Thanks in advance
CASEstatement. Why don't you add this case statement back into your SQL query in your dataset? In many cases, it's easier to manipulate data in the dataset itself. Luckily, you can have as many datasets as you need to do your report. - Sonny Childs