Pass wildcard character through variable to SQL query?

Is it possible to pass the wildcard (%) to the SQL query via a variable filter?

I have a text variable called ‘Part Number’.

I would like to be able to enter 959995-%

and have it return:

959995-1
959995-2
959995-3

Right now it returns the ‘No results!’ message, understandably, as there is no record in the DB for ‘959995-*’.

Is there special syntax to achieve this either in the variable input field or in the underlying SQL code in the editor?

Hi @jmarusiak
Yes, if you use LIKE - have a look at this:
https://www.metabase.com/blog/search-widget/index.html#add-a-search-widget-to-your-sql-question

Thank you very much! That did the trick

Not sure how I missed that in the documentation. :grimacing: