# Using Client tag in Named Query

**URL:** <https://forum.inductiveautomation.com/t/using-client-tag-in-named-query/19396>\
**Category:** Ignition\
**Created:** [August 23, 2018, 8:29pm UTC](https://forum.inductiveautomation.com/t/using-client-tag-in-named-query/19396 "2018-08-23T20:29:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user1](https://avatars.discourse-cdn.com/v4/letter/u/5daacb/32.png) [@user1](https://forum.inductiveautomation.com/u/user1)\
**Post date:** [August 23, 2018, 8:29pm UTC](https://forum.inductiveautomation.com/t/using-client-tag-in-named-query/19396/1 "2018-08-23T20:29:52Z")

</div>

Hey, I seem to be having an issue getting a named query to use the current value in a client tag, to filter a SQL query i'm doing.

> SELECT compressor.comp\_name,  
> compressor.comp\_ID,  
> asset.asset\_name  
> FROM compressor  
> INNER JOIN asset ON compressor.comp\_ID = asset.asset\_\_id  
> WHERE compressor.comp\_name = :CompName

If i create a Value or QueryString parameter pointing to the client tag:

> {[Client]SelectedComp} **#Currently has value of Selected Compressor in the DB - BristolComp003**  
> I get no results.

If i manually set the WHERE clause to **WHERE compressor.comp\_name = 'BristolComp003'**  
It works. Is there something i'm missing as to how to use the client tag properly to filter this named query? Thanks.

---

<div class="post-metadata">

**Author:** ![user1](https://avatars.discourse-cdn.com/v4/letter/u/5daacb/32.png) [@user1](https://forum.inductiveautomation.com/u/user1)\
**Post date:** [August 23, 2018, 9:49pm UTC](https://forum.inductiveautomation.com/t/using-client-tag-in-named-query/19396/2 "2018-08-23T21:49:09Z")

</div>

Nevermind figured it out. Had to use:

> **system.tag.read("[Client]SelectedComp").value**
