SSRS 2005 use variable more than once

  • Hello

    I am trying to return a "last login" time for a user in 2 different databases using SSRS 2005.

    The user's "user ID" is the same in both systems so my SQL queries are very basic:

    select userid, max(logintime) from database where userid = @userid group by userid

    When I run the report it gives me a userID box where I can enter the user's name. However, if I have 2 queries, can I use this parameter twice? I'd rather keep this all in one report but open to suggestions.

    Thanks in advance for any assistance.

  • Yes, 2 datasets in a single report can reference a single parameter.

  • Hi

    Thanks for your response.

    So I have 2 reports, each with it's own data set. These work individually.

    I can add both to a single report but get an error "sub report could not be shown".

    How do I use a parameter here which will set the userID in both sub reports?

    Thanks.

  • Got this one sorted after speaking to a colleague, thanks.

    FYI - added UserID via Report -> Report Parameters and then added these to the individual reports via report properties.

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

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