# Fallback Value

**URL:** <https://forum.inductiveautomation.com/t/fallback-value/3559>\
**Category:** Ignition\
**Created:** [November 4, 2011, 6:21pm UTC](https://forum.inductiveautomation.com/t/fallback-value/3559 "2011-11-04T18:21:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jcam](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@Jcam](https://forum.inductiveautomation.com/u/Jcam)\
**Post date:** [November 4, 2011, 6:21pm UTC](https://forum.inductiveautomation.com/t/fallback-value/3559/1 "2011-11-04T18:21:58Z")

</div>

I have been getting this error when I run a SQL query and it returns no rows. If I check the enable box for the Fallback Value and give it a value, it still gives me the same error.

If the SQL query does return any rows, then I get no errors.

Exception: Conversion error: query returned null, binding needs “double”  
on query binding for “ExtruderTime7.Root Container.TimeFromDB.value”

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [November 4, 2011, 6:34pm UTC](https://forum.inductiveautomation.com/t/fallback-value/3559/2 "2011-11-04T18:34:20Z")

</div>

Right, the fallback value is for when the query returns NO rows. You are running into the case where the query is returning a row and the value is NULL. You need to use the COALESCE function to convert a NULL to something else in your SQL query.`SELECT COALESCE(Column, "Fall Back Value") FROM Table WHERE ....`

---

<div class="post-metadata">

**Author:** ![Jcam](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@Jcam](https://forum.inductiveautomation.com/u/Jcam)\
**Post date:** [November 4, 2011, 7:24pm UTC](https://forum.inductiveautomation.com/t/fallback-value/3559/3 "2011-11-04T19:24:24Z")

</div>

Ahh, learn something new everyday. Thanks, that worked out well.
