# Query tag problem

**URL:** <https://forum.inductiveautomation.com/t/query-tag-problem/10293>\
**Category:** Ignition\
**Created:** [July 30, 2015, 2:41pm UTC](https://forum.inductiveautomation.com/t/query-tag-problem/10293 "2015-07-30T14:41:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea.montresor](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@andrea.montresor](https://forum.inductiveautomation.com/u/andrea.montresor)\
**Post date:** [July 30, 2015, 2:41pm UTC](https://forum.inductiveautomation.com/t/query-tag-problem/10293/1 "2015-07-30T14:41:58Z")

</div>

Hello,  
I have a problem in a query tag. This is my query:

`select cd_response
from response
where id_status = 0 and id_barcode_supplier = {[.]FEEDER_CODE}
order by dt_time_stamp`

FEEDER\_CODE tag is in the same folder of query tag.  
id\_barcode\_supplier and feeder\_code are two strings, but I get this error:  
Last Error Error evaluating tag: Incorrect syntax near the keyword ‘order’. ERROR

How can I fix?

Thanks

---

<div class="post-metadata">

**Author:** ![ray.crowder](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@ray.crowder](https://forum.inductiveautomation.com/u/ray.crowder)\
**Post date:** [July 30, 2015, 3:00pm UTC](https://forum.inductiveautomation.com/t/query-tag-problem/10293/2 "2015-07-30T15:00:18Z")

</div>

Try putting {[.]FEEDER\_CODE} in single quotes like this ‘{[.]FEEDER\_CODE}’ so that it reads it in as a string.

---

<div class="post-metadata">

**Author:** ![andrea.montresor](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@andrea.montresor](https://forum.inductiveautomation.com/u/andrea.montresor)\
**Post date:** [July 31, 2015, 6:18am UTC](https://forum.inductiveautomation.com/t/query-tag-problem/10293/3 "2015-07-31T06:18:26Z")

</div>

Now it works.

Thank you so much!

Andrea

---

<div class="post-metadata">

**Author:** ![iscrac](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iscrac/32/49757_2.png) [@iscrac](https://forum.inductiveautomation.com/u/iscrac)\
**Post date:** [October 9, 2020, 11:27am UTC](https://forum.inductiveautomation.com/t/query-tag-problem/10293/4 "2020-10-09T11:27:19Z")

</div>

> [@ray.crowder](#):
>
> in single quotes like this ‘{[.]FEEDER\_CODE}’

You know... in 8.0.16 version of Ignition this trick is not working.  
Who can give some advice how to link a tag in query??

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [October 9, 2020, 12:17pm UTC](https://forum.inductiveautomation.com/t/query-tag-problem/10293/6 "2020-10-09T12:17:12Z")

</div>

This works for me. Can you share more about your tag structure and the query you’re using?  
Here are some working examples when looking for record by int and strings.

```auto
SELECT * FROM table WHERE id = {[.]Int Tag}

```

```auto
SELECT * FROM table WHERE name = '{[.]StringTag}'

```

---

<div class="post-metadata">

**Author:** ![iscrac](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iscrac/32/49757_2.png) [@iscrac](https://forum.inductiveautomation.com/u/iscrac)\
**Post date:** [October 9, 2020, 12:41pm UTC](https://forum.inductiveautomation.com/t/query-tag-problem/10293/7 "2020-10-09T12:41:48Z")

</div>

> [@code\_skin](#):
>
> This works for me. Can you share more about your tag structure and the query you’re using?

I use Query tag  
I need use a string tag inside it, but this **'{[.]StringTag}'** thing is not working... If I type string manually (for example **'Lazy Pumpstation'** ), so it works, but when I link a string tag like **'{[.]PumpStationName}'** it does not work..

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [October 9, 2020, 12:57pm UTC](https://forum.inductiveautomation.com/t/query-tag-problem/10293/8 "2020-10-09T12:57:01Z")

</div>

Can you share some screenshots?
