Reputation: 2489
I need to grab the Month and Year info from 2 date/time parameters of my report (Start date and End date) into a textbox.
I used the following expression -
=MonthName(Month(Parameters!StartDate.Value)) & Format(Year(Parameters!EndDate.Value)) & " to " & MonthName(Month(Parameters!EndDate.Value)) & Format(Year(Parameters!EndDate.Value))
to get it into something like e.g. March 2012 to August 2012.
It works, however I keep getting the following Warning:
[rsRuntimeErrorInExpression] The Value expression for the textrun ‘Textbox18.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from type 'Date' to type 'Integer' is not valid.
Any ideas?
Thanks!
Upvotes: 1
Views: 3953
Reputation: 20560
Is that the exact expression you are using? It doesn't seem like it is because:
So I would guess that one of the functions in the actual expression is MonthName(Parameters!StartDate.Value)
rather than MonthName(Month(Parameters!StartDate.Value))
which would give the error indicated.
This also works:
=MonthName(Month(Parameters!StartDate.Value)) & " " & Year(Parameters!StartDate.Value).ToString() & " to " & MonthName(Month(Parameters!EndDate.Value)) & " " & Year(Parameters!EndDate.Value).ToString()
Either that or this isn't the expression in Textbox18
Upvotes: 1