Date Parameter Format Problem in Deployed Reports

  • Guys, please give me your advice on this.

    I have created and deployed 2 reporting services reports in our report server.

    When I 'execute' the report through remote connection from the server that I have deployed them, I enter the datefrom and dateto parameters in the format DD/MM/YY.

    However, when i try to execute the reports from my computer, (http), if i enter the parameter in the form DD/MM/YY i get the 'wrong date format' message. In order the report to work, i need to enter the date in US format (MM/DD/YY).

    Why is that? how can i fix it, so that all users enter date in the form dd/mm/yy (similar to the server)?

    I would be gratefull for your help...

     


    "If you want to get to the top, prepare to kiss alot of bottom"

  • we're using RS2000 herenot sure what version you have... but I would try this...

    Declare your date params STRING, this what you need to hold a date format of dd/mm/yyyy. Then in your query WHERE clause insert the following...

    MyDateField BETWEEN CONVERT(DATETIME,@Start_Date,103) AND CONVERT(DATETIME,@End_Date,103)

    So here you're converting the VARCHAR to a SQL DATETIME using the convertion format 103 (dd/mm/yyyy). You need to think about time if your field contains time as well, as the above will truncate datetimes to dd/mm/yyyy 00:00:00.000.

    To solve this you can change your @enddate convertion to the following

    CONVERT (DATETIME, CONVERT (CHAR (11), @End_Date, 103) + '23:59:59.997', 103)

    Kindest Regards,

    Martin


    Kindest Regards,

    Martin

  • Martin,

    although i had checked the 'Notify me when users reply' in my post (I am dfalir) it seems that i missed your answer.

    I was looking in Google today to solve the same problem, and saw your answer, to my post!

     Sincerely thank you, for the solution which i will try it and let you know.

     

     


    "If you want to get to the top, prepare to kiss alot of bottom"

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

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