# Pass Wildcard to Report Query for one letter

**URL:** <https://forum.inductiveautomation.com/t/pass-wildcard-to-report-query-for-one-letter/82843>\
**Category:** Ignition\
**Tags:** reporting\
**Created:** [December 7, 2023, 2:22pm UTC](https://forum.inductiveautomation.com/t/pass-wildcard-to-report-query-for-one-letter/82843 "2023-12-07T14:22:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Schiavone8](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Schiavone8](https://forum.inductiveautomation.com/u/Schiavone8)\
**Post date:** [December 7, 2023, 2:22pm UTC](https://forum.inductiveautomation.com/t/pass-wildcard-to-report-query-for-one-letter/82843/1 "2023-12-07T14:22:37Z")

</div>

I am trying to have a report where users can select from items with a single letter designation like A, B, C, etc. Is there a way to pass a wildcard to the report that can be used in the SQL query to get all of the letters instead of just one? I have tried using "LIKE" but when I use that, none of them work. I have only been able to get it to show data when using "=" and a letter.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 7, 2023, 3:09pm UTC](https://forum.inductiveautomation.com/t/pass-wildcard-to-report-query-for-one-letter/82843/2 "2023-12-07T15:09:54Z")

</div>

Post exactly what you've tried for the SQL query using LIKE. It should be possible.

---

<div class="post-metadata">

**Author:** ![Schiavone8](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Schiavone8](https://forum.inductiveautomation.com/u/Schiavone8)\
**Post date:** [December 7, 2023, 3:39pm UTC](https://forum.inductiveautomation.com/t/pass-wildcard-to-report-query-for-one-letter/82843/3 "2023-12-07T15:39:33Z")

</div>

It is just  
SELECT a bunch of things  
FROM db  
WHERE machine = ? AND etc (switching the = to LIKE for the attempt to do this)  
and the ? is a parameter from a dropdown on the screen that is a string. So when I put in % or \_ for the value to pass, nothing happens and the letters do not work either then. I have tried passed just A and 'A' and nothing happens.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 7, 2023, 3:43pm UTC](https://forum.inductiveautomation.com/t/pass-wildcard-to-report-query-for-one-letter/82843/4 "2023-12-07T15:43:18Z")

</div>

What DB are you using? MySQL, Postgres, SQL server?

---

<div class="post-metadata">

**Author:** ![Schiavone8](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Schiavone8](https://forum.inductiveautomation.com/u/Schiavone8)\
**Post date:** [December 7, 2023, 3:44pm UTC](https://forum.inductiveautomation.com/t/pass-wildcard-to-report-query-for-one-letter/82843/5 "2023-12-07T15:44:31Z")

</div>

SQL Server

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 7, 2023, 4:01pm UTC](https://forum.inductiveautomation.com/t/pass-wildcard-to-report-query-for-one-letter/82843/6 "2023-12-07T16:01:44Z")

</div>

Try something like:

```sql
SELECT a bunch of things
FROM db
WHERE machine LIKE ? || '%'

```

Using MSSQL's double pipe concatenation operator. Or, if that doesn't work, `LIKE CONCAT(?, '%')` maybe.

---

<div class="post-metadata">

**Author:** ![Schiavone8](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Schiavone8](https://forum.inductiveautomation.com/u/Schiavone8)\
**Post date:** [December 7, 2023, 4:54pm UTC](https://forum.inductiveautomation.com/t/pass-wildcard-to-report-query-for-one-letter/82843/7 "2023-12-07T16:54:51Z")

</div>

Okay so the CONCAT seems to work while using it in the query. I thought I tried that, but know I tried to put that in the parameter box and that did not work. I will implement this outside of the test environment, but it worked here. Must have had some syntax wrong before. Thank you!!!
