Use the like operator with the parameter

edited 6:00AM in FastReport .NET
Hi

I want to use the Like operator. How is this done?

for example:
SELECT * FROM T1 WHERE Id LIKE N'%@ID%'

This code does not show anything

help me please, Thanks

Comments

  • edited April 2018
    try

    SELECT * FROM T1 WHERE Id LIKE '%' & @ID & '%'

    note: msaccess database
  • edited 6:00AM
    Thank you

    Your code was correct and only needed a small change.
    Instead of & should be + used.

    SELECT * FROM T1 WHERE Id LIKE '%' + @ID + '%'

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.