Results 1 to 3 of 3

Thread: Parameter in function

  1. #1
    Join Date
    Nov 2002
    Location
    cornwall
    Posts
    187

    Parameter in function

    Hi,

    this has started from me wanting to write a report that allowed the user to choose from a drop down list of how many months they want the report to cover. IE i want the report for the last 3 months, or 5 months or ...

    To do this i created a report with a value list parameter (values are negative integers to give the necessary start date for the reported rows) and had that parameter in the where clause, along the lines of ...
    select *blah*
    from *blah*
    where ( *myfield* > dateadd (mm, @MonthParam, GetDate())

    i get a sql error (ie an error from the database not reporting services) saying that the variable hasnt been declared.

    I have worked around the problem in this instance but is there a 'feature' in RS that means report parameters cannot take part in functions?


    TIA

  2. #2
    Join Date
    Jan 2006
    Location
    USA
    Posts
    19
    Yes that parameter has to be in function as IP para. Local execution of function will check for all the used variables used in it and will give out error

  3. #3
    Join Date
    Nov 2002
    Location
    cornwall
    Posts
    187
    Yogesh, thanks for the response. Can you give me an example of how i can get around this please?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •