locked
Optional Parameters - Not taking values when supplied RRS feed

  • Question

  • All,

    I have a report that takes 2 optional parameters, one int and one datetime.

    My data tab is set up as follows: CommandType = Text, Parameters has Parameters.Value etc. for both.

    Report Parameters are allowed NULL value, Default Value is NULL, datatypes are Integer and Datetime as well.

    This only runs when the parameters are not supplied values, when I enter a date, it does not take it into account, same for the int value.

    I have run the proc manually to verify that the query is set up correctly, it seems like the values are not being passed?

    Any help debugging this would be helpful.

    Thanks.

    Thursday, August 26, 2010 5:31 PM

Answers

  • Instead of Defaulting the Date to NULL, I used DateAdd to get the default date. Thanks !
    • Marked as answer by Ben Arthur Friday, August 27, 2010 3:02 PM
    Friday, August 27, 2010 3:01 PM

All replies

  • Hi Ben,

    Does the dataset bind the parameters defined by you? Open the dataset Properties box, and go to Parameters page to check if the defined parameters is binded to the dataset. If these were correct, please give us more details about your report.

    thanks,
    Jerry

    Friday, August 27, 2010 8:14 AM
  • Yes, it does bind. On further research, I found that the int parameter works as defined, the datetime parameter does not.

    Is there a way to default the date to Today - 7 days? Basically thats what the proc does when no date is passed.

    TIA,

    Ben

    • Marked as answer by Ben Arthur Friday, August 27, 2010 3:02 PM
    • Unmarked as answer by Ben Arthur Friday, August 27, 2010 3:02 PM
    Friday, August 27, 2010 2:37 PM
  • Instead of Defaulting the Date to NULL, I used DateAdd to get the default date. Thanks !
    • Marked as answer by Ben Arthur Friday, August 27, 2010 3:02 PM
    Friday, August 27, 2010 3:01 PM