Using on Parameter to limit the second

  • I have two Parameters.. Model and Plant, created by using two data sets (Model, Plant)

    Is it possible, for the Plant to use Model to limit the selections it shows?

    Currently I have select statements in both that take the data and group by + Order By Model or Plant depending on the data set...

    Example:

    SELECT MODELCODE

    FROM MOM_GSCS_UNMET_IC_DAILY_SUMMARY

    GROUP BY MODELCODE

    ORDER BY MODELCODE

  • Sure. It's called cascading parameters.

    http://msdn.microsoft.com/en-us/library/aa337169(v=sql.100).aspx

    Your query would look like this:

    SELECT PLANTCODE

    FROM MOM_GSCS_UNMET_IC_DAILY_SUMMARY

    WHERE MODELCODE = @ModelCode

    GROUP BY PLANTCODE

    ORDER BY PLANTCODE

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Great! Thanks for the Help!

    David

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

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