locked
Problem with showing Current Date selected as Default in DateTime Parameters using Report Builder RRS feed

  • Question

  • User946142141 posted

    I have to show current date selected as default in Date range parameters.so going through parameter properties,selecting Default values,using expression "Today()" in  specific values.
    But the problem is Current date is not showing Initially,after a postback only it works.

    Wednesday, October 24, 2012 11:58 PM

Answers

  • User-1051986203 posted

    The above query showing that you are converting date in varchar datatype. so either you have to change your where condition or to convert above query to date.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 25, 2012 3:15 AM

All replies

  • User-1051986203 posted

    Go to parameter properties & assign Now() in default expression for date parameter, this will initially get in report preview.

    or

    create new dataset using below query for date parameter. You can pass this into parameter and it will show initially value.

    SELECT GETDATE() as Todaydate
    Thursday, October 25, 2012 12:25 AM
  • User-179079940 posted

    use getdate() function this provide to day date

    Thursday, October 25, 2012 12:53 AM
  • User946142141 posted

    Now iam getting the Date Time in the parameter.I want to show Date alone without time to user to select.I used the below code in query.but it throws error

    SELECT CONVERT(VARCHAR(10),GETDATE(),111) as CurrentDate

    Thursday, October 25, 2012 2:51 AM
  • User-1051986203 posted

    The above query showing that you are converting date in varchar datatype. so either you have to change your where condition or to convert above query to date.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 25, 2012 3:15 AM