Search code examples
visual-studio-2008report-designer

Visual Studio 2008 report designer multiple values passed for single label parameter


In parameter properties is there a way to pass multiple values with one label? I have a drop down box containing 7 choices on which department is desired some departments only have one account code and others multiple. I've tried ('123', '321') this would be equivelent to the query syntax needed. The code I'm using now for the parameter in syntax is (table.column IN (@parameter)) should this be written differently?

Thanks for any suggestions.

    FROM gl_master,   
     gl_master_comp_v,   
     budget_off_mstr  
    WHERE ( gl_master.acct_cde = gl_master_comp_v.acct_cde ) and  
     ( gl_master.budget_officer = budget_off_mstr.budget_officer ) and  
     ( ( gl_master_comp_v.acct_comp1 = '01' ) AND  
     ( budget_off_mstr.budget_officer in (@BudgetOfficer) ) ) 

Solution

  • I solved it. However, I'm sure there is a simpler/cleaner way of doing this.

    I placed the parameter values as the account names. The account codes were defined within the query and the parameter value was included with a AND. Basically recreating all of the WHERE for each account name seperated with a OR. Code below:

     WHERE ( g.acct_cde = l.acct_cde ) and  
         ( g.budget_officer = b.budget_officer ) and  
         ( ( l.acct_comp1 = '01' ) ) AND  
         ( b.budget_officer IN ('48564') ) AND 
     (@BudgetOfficer = 'AM') 
    OR   
         ( g.acct_cde = l.acct_cde ) and  
         ( g.budget_officer = b.budget_officer ) and  
         ( ( l.acct_comp1 = '01' ) ) AND  
         ( b.budget_officer IN     
    ('3543', '3523', '06588', '58568', '48656','58544', '48648') ) AND 
    (@BudgetOfficer = 'Dean_AA')
          OR
    

    and so on...