locked
Data type mismatch RRS feed

  • Question

  • Hi,

    I have Report 1 with field StartDate as Datetime

    I have Report 2 with field Startdate as Integer.

    I am using "go to report" to go from report 2 to report 1 but when passing in the parameters it complains of a mismatch in type.

    How can I convert integeter into Date/Time in the expersion when passing parameters.

    please help.

    Thanks

     

     

    Thursday, April 29, 2010 7:27 AM

Answers

  • Hello,

    Depends on the format you used for the int. If it's yyyymmdd:

    =DateSerial( Left(CStr(Fields!DateInt.Value), 4)

               , Mid(CStr(Fields!DateInt.Value), 5, 2)

               , Right(CStr(Fields!DateInt.Value), 2))

     


    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    • Proposed as answer by Challen Fu Tuesday, May 4, 2010 7:53 AM
    • Marked as answer by Milli_22 Tuesday, May 4, 2010 10:06 AM
    Thursday, April 29, 2010 7:43 AM

All replies

  • Hi,

    Convert the DateTime to Interget by using CONVERT Function ( use the third parameter for the format you want) in parameter expression in go to report field.

    Thanks,Ravi

    • Proposed as answer by Challen Fu Tuesday, May 4, 2010 7:45 AM
    • Unproposed as answer by Milli_22 Tuesday, May 4, 2010 10:06 AM
    Thursday, April 29, 2010 7:38 AM
  • Hello,

    Depends on the format you used for the int. If it's yyyymmdd:

    =DateSerial( Left(CStr(Fields!DateInt.Value), 4)

               , Mid(CStr(Fields!DateInt.Value), 5, 2)

               , Right(CStr(Fields!DateInt.Value), 2))

     


    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    • Proposed as answer by Challen Fu Tuesday, May 4, 2010 7:53 AM
    • Marked as answer by Milli_22 Tuesday, May 4, 2010 10:06 AM
    Thursday, April 29, 2010 7:43 AM