sql server - SSRS Syntax Error when trying to use Parameter in table name and Where Clause -
i'm attempting create report needs 2 parameters in ssrs. 1 of them used change table selected each time query run. tables have years in them (e.g. ta_2014) , depending on year they'd see, they'll need see different table. second parameter term, though don't believe giving me issue.
my query looks in ssrs
="select p.id, p.last_name + ', ' + p.first_name 'student_name', ta.ta_term_amount person p, ta_" & parameters!pyear.value & " ta p.id = substring(ta.ta_" & parameters!pyear.value & "_id,1,7) , ta.ta_" & parameters!pyear.value & "_id '%pell%' , ta.ta_term_manual_chg = 'y' , right(ta.ta_" & parameters!pyear.value & "_id,6) = @pterm order student_name"
i'm getting syntax error near ','
when take out " & parameters!pyear.value & " , hard code in year, 2014 example, report runs fine. have other reports i've done exact thing tables, can't work now. i'm missing something. i've been comparing older reports weeks , i'm not seeing why older reports work , new ones not. idea?
Comments
Post a Comment