Report parameters

  • Hi,

    I have 3 parameters in my report.

    @Duration, @start , @end.

    based on the type of duration is selected, @start and @end should take default values accordingly.

    @start and @end come from Stored Proc while @duration is only in report:

    @duration has has static string values and labels like:

    labels - value

    1pm yesterday to 2 pm today - 1

    3pm yesterday to 4 pm today -2

    4am yesterday to 3pm today -3

    and so on...

    based on the type of duration is selected, @start and @end should take default values accordingly.

    I have in my @start report parameter expression like

    = Switch(Parameters!Duration.Value= "1", CDate(DateValue(dateadd("d",-1, Globals!ExecutionTime)) + "13:00:00")

    ,Parameters!Duration.Value="2", CDate(DateValue(dateadd("d",-1, Globals!ExecutionTime)) + "15:00:00")

    ,Parameters!Duration= "3", CDate(DateValue(dateadd("d",-1, Globals!ExecutionTime)) + "04:00:00")

    )

    and @end is also set up like this

    but everytime I run the report it errors saying ; error during processing of @start.

    What am I missing out here? thanks.

  • Is this a typo in your post or in your code ...

    Parameters!Duration= "3"

    Should be .....

    Parameters!Duration.Value= "3",

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • You'll also need to insert a space before the time portion.

    CDate(DateValue(dateadd("d",-1, Globals!ExecutionTime)) + " 04:00:00")

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • Jason Selburg (11/28/2011)


    You'll also need to insert a space before the time portion.

    CDate(DateValue(dateadd("d",-1, Globals!ExecutionTime)) + " 04:00:00")

    Thank you so much Jason. it was a typo and I added a space before time and it worked great.

    Now I can have default timings , the user mentioned that he should still be able to select any @start any @end (for instance any day , anytime) at his will, apart from these above mentioned default timings that I just put in the report. for instance he may want to check last 4 days or anything like that

    Is there a way to day that? I was thinking of making @duration (allow null value) but how to make @ start and @end behave accordingly?

    thanks again

  • I just figured it out, thanks

Viewing 5 posts - 1 through 4 (of 4 total)

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