Need Parameters For Dummies

  • I wrote this query here and by the way I am very brand new to SSRS and creating actual reports I have only written basic queries for data. So I am getting used to Visual Studio and Report Builder after taking SSIS and SSRS last week. I am wondering if someone would be so kind to show me how to install a parameter into my report? I am wanting to only pull up data from my "work_dt" field queried by a date range so for example if I chose 1/1/11 - 1/20/11

    Here is a copy of my query any help would greatly be appreciated!

    SELECT

    a.Request_id as 'Request ID',

    a.work_dt as 'Work Date',

    c.org_svc_grp_b as 'District',

    c.[Name] as 'Place Name',

    a.model_id as 'Model ID',

    a.serial_id as 'Serial ID',

    b.cust_prob_descr as 'Problem Reported',

    d.[text] as 'Request Text',

    e.[text] as 'Task Text'

    FROM

    non_part_usage a

    left outer join request b on a.request_id = b.request_id

    left outer join place c on b.place_id = c.place_id

    left outer join request_text d on b.request_id = d.request_id

    left outer join project_text e on a.project_id = e.project_id

    WHERE

    a.work_dt > '3/20/11'

    and a.work_dt < '3/25/11'

  • Did you try google?

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • The way you implement parameters will be slightly different, depending on where the code for the report sits. If the code is embedded in the report - then you need to first define the report parameters, then you can use the parameters in the query.

    If the code is in a stored procedure (my recommendation) - then you just need to use the stored procedure as the source and SSRS will build the report parameters and map them to your stored procedure parameters.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

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

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