need expression for startdate and end date

  • Hello,

    I have an ssrs report in the header I am trying to display report start date and report end date.

    This is old active report we are converting to ssrs.

    In the active report start date and end date is like this

    fiscalYear = System.DateTime.Now.Date.Year;

    claimMonth = System.DateTime.Now.Date.Month - 1;

    startFY = Convert.ToDateTime(Convert.ToString(claimMonth) + "/01/" + Convert.ToString(fiscalYear-3));

    endFY = Convert.ToDateTime(Convert.ToString(claimMonth) + "/01/" + Convert.ToString(fiscalYear));

    this.repStartFY.Text = startFY.Date.ToShortDateString();

    this.rptEndFY.Text = endFY.Date.ToShortDateString();

    In ssrs report I taken a text box and written expression as

    ="Report Start Year Date:" + System.DateTime.Now.Date.Month-1

    + "/01/" + System.DateTime.Now.Date.Year-3

    ="Report End Year Date:" + System.DateTime.Now.Date.Month-1

    + "/01/" + System.DateTime.Now.Date.Year

    But its showing error not sure where I am doing mistake;Any help..

  • You need to convert your Month and Year to strings in order for the "+" to be concatenation and not addition and you can't add a string and integers.

    You can use CStr(Number) or (Number).ToString()

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply