# Easy Chart problem getting query from DB Pens

**URL:** <https://forum.inductiveautomation.com/t/easy-chart-problem-getting-query-from-db-pens/35898>\
**Category:** Ignition\
**Created:** [June 23, 2020, 7:16am UTC](https://forum.inductiveautomation.com/t/easy-chart-problem-getting-query-from-db-pens/35898 "2020-06-23T07:16:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kerwin.grapa](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@kerwin.grapa](https://forum.inductiveautomation.com/u/kerwin.grapa)\
**Post date:** [June 23, 2020, 7:16am UTC](https://forum.inductiveautomation.com/t/easy-chart-problem-getting-query-from-db-pens/35898/1 "2020-06-23T07:16:40Z")

</div>

Good day,

When I am programming in the Designer, the Easy Chart runs okay. But when running on the Client, the chart will get error of database query.

This is the diagnostic I run on the Easy Chart.

PenSQLQuery “SELECT t\_stamp, pal2\_generator\_active\_power\_total FROM nigbu\_load WHERE t\_stamp \>= ? ORDER BY t\_stamp”: Good

I don’t understand where the t\_stamp get the ? value.

Screenshot was on the Designer.  
 ![screenshot1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/68995c5ec5a554a219dc8d21b6b4ad3d4bc33280.jpeg) !

Screenshot was on the Client  
[screenshot2|577x218](https://forum.inductiveautomation.com/uploads/short-url/owTZ9WfKYCLn50x8wuy0Onh4Mmd.jpeg)

Thank you very much. Any help would be much appreciated.

---

<div class="post-metadata">

**Author:** ![pascal](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@pascal](https://forum.inductiveautomation.com/u/pascal)\
**Post date:** [June 23, 2020, 8:24am UTC](https://forum.inductiveautomation.com/t/easy-chart-problem-getting-query-from-db-pens/35898/2 "2020-06-23T08:24:48Z")

</div>

Hi,

Since you are running your Easy Chart in RealTime, the query syntax is automatic.  
I believe the “?” value is just the current date minus the time configured under the Chart (in your case 2 hours).

The fact that the Easy Chart does not run in Client is probably a Project Property issue.  
In the designer, go to Project/Properties under Client/Permissions make sure that Legacy Database Access is enabled.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/d/6d7c77ec3ca00a4543efe6b4e9394240a761476f.png)

If not, check it and save your project.

---

<div class="post-metadata">

**Author:** ![kerwin.grapa](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@kerwin.grapa](https://forum.inductiveautomation.com/u/kerwin.grapa)\
**Post date:** [June 23, 2020, 1:16pm UTC](https://forum.inductiveautomation.com/t/easy-chart-problem-getting-query-from-db-pens/35898/3 "2020-06-23T13:16:25Z")

</div>

Good day sir,

Thank you very much for the help. Much appreciated.

Have a nice day.
