SQL Server query IF equal username -
using sql server 2008, have ssrs report data of employers's projects. report has filter of employer's name. in sharepoint when user open report, system check name , put in employer_name filter. user see information projects only.
select [employee name], project, level1, level2, level3 table_1 [employee name] in (@reportparameter_employer_name)
but need insert in query 1 user not in table. user must see employer's projects , other information.
so query should like:
if (@reportparameter_employer_name) = alexander50 select [employee name], project, level1, level2, level3 table_1 if (@reportparameter_employer_name) ≠ alexander50 select [employee name], project, level1, level2, level3 table_1 [employee name] in (@reportparameter_employer_name)
hope correct syntax of query if such query possible. or mb solution.
you looking simple or
operator:
select [employee name], project, level1, level2, level3 table_1 [employee name] = @reportparameter_employer_name or @reportparameter_employer_name = 'alexander50';
Comments
Post a Comment