report expression for month and year


  • Hi ,

    Can anyone help me how to write a report expression to get the following out put?

    Actually this value is the month of previous month. I want to set default month name of the parameter to previous month. This is sep.So it should display like this;

    Aug - 10


    sexta-feira, 10 de setembro de 2010 17:58


Todas as Respostas

  • so you are trying to convert a date value into MMM - YY format?

    if so try this:

    =format(today, "MMM - yy")

    • Marcado como Resposta workplacemobbing quinta-feira, 16 de setembro de 2010 18:17
    sexta-feira, 10 de setembro de 2010 18:03
  • Hello,

    Yes that is what I want.

    Now the problem is i get an error message when i try to view the report.

    " Query execution failed for the dataset 'DataSet1'.

    Error converting data type nvarchar to datetime.

    Data type of the available value(Dataset2)  is varchar. I set parameter type as text.

    I am not sure why i still get the error message?


    sexta-feira, 10 de setembro de 2010 19:35
  • well you are using a string at a place you are supposed to use a date, cant help much without seeing the queries but you can convert your varchar values to datetime using the Convert function if this is in tsql


    sexta-feira, 10 de setembro de 2010 23:36
  • Hi,

    Add to the reply from Nehemiah Willis, in reporting services, there is a CDate built-in function which can be used to convert the string to Datetime. So, the expression can be =Format(CDate<Field>,"MMM-yy").

    please let us know if you have more question.


    segunda-feira, 13 de setembro de 2010 06:59