May 29, 2012 at 8:47 am
Hi All,
I have a date field from 01/08/2010 - 06/06/2011. In my report, I want this date to show as 2010 August or 2011 June respectively based on the value of the date field. Now I have written an expression which doesnt work.
FormatNumber(Year((Fields!StartDate.value), "####") + " " + Month (Fields!StartDate.value). Can someone help me with the expression.
May 29, 2012 at 10:04 am
eobiki10 (5/29/2012)
Hi All,I have a date field from 01/08/2010 - 06/06/2011. In my report, I want this date to show as 2010 August or 2011 June respectively based on the value of the date field. Now I have written an expression which doesnt work.
FormatNumber(Year((Fields!StartDate.value), "####") + " " + Month (Fields!StartDate.value). Can someone help me with the expression.
You are mixing data types in your expression, and therefore the issues. Try casting all the elements in your expression (which returns numbers) explicitly to a string.
For example: cstr(FormatNumber...) + " " + Month(...)
Can't remember whether the "Month" function returns a string or number for the month, so you may have to double-check that.
Hope this helps.
May 29, 2012 at 10:52 am
I would think you could just do this:
=YEAR(Fields!StartDate.value) + " " + MONTHNAME(MONTH(Fields!StartDate.value))
May 29, 2012 at 6:19 pm
Use the VB & instead of SQL + to concatenate in SSRS expression.
May 31, 2012 at 6:14 am
You may try:
CDate(Fields!StartDate.Value.ToString()).ToString("yyyy-MMMM")
Cheers,
Hope this helps,
Rock from VbCity
May 31, 2012 at 4:09 pm
Thanks folks. The one that I tried earlier that worked is =YEAR(Fields!StartDate.value) & " " & MONTHNAME(MONTH(Fields!StartDate.value))
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply