2283
Views
1
Comments
How do I find '%' with the LIKE operator in Filter
Question

I am coding OSMDb excercises in the Training course.

In Movies screen, I have a search button, it allows search the Movies by Title or PlotSummary.

When I enter '%' or '_' to the search input, and click button search, the results always are all the records in the database.

In Agg, in Filters tab I have a filter:

Movie.Title like "%" + SearchText + "%" 
or Movie.PlotSummary like "%" + SearchText + "%"

How can I do to only search the movie, which has Title or PlotSummary contain '%' or '_' character?

Please help me!

Thanks!

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hi.

You have to escape the special characters in advance.

where Movie.PlotSummary like '%[%]%'

or

where Movie.PltSummary like '%!%%' escape '!'

will probably do.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.