# Text Data from SQL Query

**URL:** <https://forum.inductiveautomation.com/t/text-data-from-sql-query/11337>\
**Category:** Ignition\
**Created:** [March 9, 2016, 2:29pm UTC](https://forum.inductiveautomation.com/t/text-data-from-sql-query/11337 "2016-03-09T14:29:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![boster281](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@boster281](https://forum.inductiveautomation.com/u/boster281)\
**Post date:** [March 9, 2016, 2:29pm UTC](https://forum.inductiveautomation.com/t/text-data-from-sql-query/11337/1 "2016-03-09T14:29:47Z")

</div>

Not sure if this is possible but figure i might a well ask.  
I want to do an sql query that returns a number

`SELECT PartStatus
FROM [Thermoplastics].[dbo].[PartTracking]
WHERE Container like '{Root Container.Container 1.text}'`

But I want to display text such as ‘Operation 120’ when the query returns 65

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [March 9, 2016, 11:01pm UTC](https://forum.inductiveautomation.com/t/text-data-from-sql-query/11337/2 "2016-03-09T23:01:53Z")

</div>

You could do this with a long list of IF THEN or a CASE statement in the query, but you would be better off creating a Lookup table with the operation description linked to the PartTracking table.  
Then you just join the tables inside the query and it will return the string value.
