# Query Works In The Database Query Browser But Not In My Report

**URL:** <https://forum.inductiveautomation.com/t/query-works-in-the-database-query-browser-but-not-in-my-report/86182>\
**Category:** Ignition\
**Tags:** ignition79, reporting\
**Created:** [February 22, 2024, 1:20pm UTC](https://forum.inductiveautomation.com/t/query-works-in-the-database-query-browser-but-not-in-my-report/86182 "2024-02-22T13:20:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![koenigs.alex](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@koenigs.alex](https://forum.inductiveautomation.com/u/koenigs.alex)\
**Post date:** [February 22, 2024, 1:20pm UTC](https://forum.inductiveautomation.com/t/query-works-in-the-database-query-browser-but-not-in-my-report/86182/1 "2024-02-22T13:20:43Z")

</div>

I'm trying to pull data in from Factory Talk Historian. When I run my query in the database query browser it works just fine (see query below). But when I run the same query in the report designer as an SQL query I get an error (see error below). Any ideas or insights?

```auto
select time,value from DataTable  
   where (tag='TagPath')  
   and (time between '2024-02-22 5:10:00' and '2024-02-22 06:10:00') and status=0 and
   timestep='1m'
   order by time;

```

> Error getting sample data.  
> ExecutionException: java.lang.ClassCastException: com.inductiveautomation.reporting.common.data.query.PrepStmtQueryConfig cannot be cast to com.inductiveautomation.reporting.common.data.NamedQueryConfig  
> caused by ClassCastException: com.inductiveautomation.reporting.common.data.query.PrepStmtQueryConfig cannot be cast to com.inductiveautomation.reporting.common.data.NamedQueryConfig  
> Ignition v7.9.10 (b2018112821)  
> Java: Oracle Corporation 1.8.0\_201

---

<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:** [February 22, 2024, 3:07pm UTC](https://forum.inductiveautomation.com/t/query-works-in-the-database-query-browser-but-not-in-my-report/86182/2 "2024-02-22T15:07:37Z")

</div>

That's just an Ignition bug.  
But, you're on an ancient version of an unsupported major version. I'd strongly recommend _at least_ upgrading to the latest 7.9 (which will be free) and at your earliest opportunity planning the migration to 8.1.

---

<div class="post-metadata">

**Author:** ![koenigs.alex](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@koenigs.alex](https://forum.inductiveautomation.com/u/koenigs.alex)\
**Post date:** [February 22, 2024, 6:21pm UTC](https://forum.inductiveautomation.com/t/query-works-in-the-database-query-browser-but-not-in-my-report/86182/3 "2024-02-22T18:21:49Z")

</div>

By a bug you mean that this just doesn't work on the version of ignition I'm running?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 22, 2024, 6:22pm UTC](https://forum.inductiveautomation.com/t/query-works-in-the-database-query-browser-but-not-in-my-report/86182/4 "2024-02-22T18:22:43Z")

</div>

Yes, that's what it means.

---

<div class="post-metadata">

**Author:** ![koenigs.alex](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@koenigs.alex](https://forum.inductiveautomation.com/u/koenigs.alex)\
**Post date:** [February 22, 2024, 6:26pm UTC](https://forum.inductiveautomation.com/t/query-works-in-the-database-query-browser-but-not-in-my-report/86182/5 "2024-02-22T18:26:01Z")

</div>

OK, thanks for the clarification.
