How do I make wildcards work in a like operator in SQL Server reporting services?

前端 未结 4 1792
孤街浪徒
孤街浪徒 2021-01-04 08:27

I have added a filter expression using the like operator. What do I put in the value field? my parameter is named @test and I\'d like the filter to function as a like %@te

相关标签:
4条回答
  • 2021-01-04 08:40

    I got this to work by adding a filter expression with a like operator and setting the value to this:

    ="*" + Parameters!Roles.Value + "*"
    

    To get all values I pass ''.

    0 讨论(0)
  • 2021-01-04 08:45

    You could also simply use string concatenation in the original Dataset that you want to filter on. You can access the parameters in the same manner as SQL:

    WHERE fieldname LIKE '%' + @test + '%'
    

    You can then link the report parameter @test to the @test in the dataset via the parameters option on Dataset Properties.

    0 讨论(0)
  • 2021-01-04 08:47

    You should use this Query in the DATA SECCTION of the REPORT WIZARD.

    SELECT * FROM HR.JOBS WHERE JOB_TITLE LIKE  :JOB_TITLE | |'%'
    
    0 讨论(0)
  • 2021-01-04 09:00

    you could use this simple query.

    WHERE fieldname LIKE CONCAT('%',@test,'%')
    

    Used CONCAT

    0 讨论(0)
提交回复
热议问题