# Report SQL query - dynamic database?

**URL:** <https://forum.inductiveautomation.com/t/report-sql-query-dynamic-database/13970>\
**Category:** Ignition\
**Created:** [April 2, 2017, 8:54pm UTC](https://forum.inductiveautomation.com/t/report-sql-query-dynamic-database/13970 "2017-04-02T20:54:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kstofcho](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@Kstofcho](https://forum.inductiveautomation.com/u/Kstofcho)\
**Post date:** [April 2, 2017, 8:54pm UTC](https://forum.inductiveautomation.com/t/report-sql-query-dynamic-database/13970/1 "2017-04-02T20:54:20Z")

</div>

Is it possible to bind the database on a Basic SQL Query within the reporting module to a tag? I am only seeing a dropdown selection and no way to bind it to a property, tag or query. I have a project set up to connect to 4 different databases depending on selected options. I suppose I can query the data in a script and send it as a dataset parameter if this is not an option but I’d like to avoid the extra work if there is a way to bind the database. Thanks!

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [April 3, 2017, 10:45pm UTC](https://forum.inductiveautomation.com/t/report-sql-query-dynamic-database/13970/2 "2017-04-03T22:45:19Z")

</div>

We’re working on a feature for 7.9.3 that would do this nicely.

---

<div class="post-metadata">

**Author:** ![systemparadox](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@systemparadox](https://forum.inductiveautomation.com/u/systemparadox)\
**Post date:** [July 10, 2018, 10:23am UTC](https://forum.inductiveautomation.com/t/report-sql-query-dynamic-database/13970/3 "2018-07-10T10:23:03Z")

</div>

It appears that this is still not implemented as of 7.9.7.

---

<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:** [July 10, 2018, 2:28pm UTC](https://forum.inductiveautomation.com/t/report-sql-query-dynamic-database/13970/4 "2018-07-10T14:28:13Z")

</div>

Actually, this is possible (as of 7.9.4); the feature Kathy’s referring to is named queries, which allow you to define the database connection used as a parameter (which can then be bound inside the report configuration).

---

<div class="post-metadata">

**Author:** ![systemparadox](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@systemparadox](https://forum.inductiveautomation.com/u/systemparadox)\
**Post date:** [July 13, 2018, 7:52am UTC](https://forum.inductiveautomation.com/t/report-sql-query-dynamic-database/13970/5 "2018-07-13T07:52:19Z")

</div>

Ah! Yes that appears to work. Thanks.
