# Display duration as 'hh:mm:ss' in chart y axis

**URL:** <https://forum.inductiveautomation.com/t/display-duration-as-hhss-in-chart-y-axis/70267>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [February 24, 2023, 4:52am UTC](https://forum.inductiveautomation.com/t/display-duration-as-hhss-in-chart-y-axis/70267 "2023-02-24T04:52:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dharani\_T](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dharani\_T](https://forum.inductiveautomation.com/u/Dharani_T)\
**Post date:** [February 24, 2023, 4:52am UTC](https://forum.inductiveautomation.com/t/display-duration-as-hhss-in-chart-y-axis/70267/1 "2023-02-24T04:52:54Z")

</div>

Hi,  
I have written the below query to display duration vs loss in a vision chart,

```auto
SELECT l.Category as label, SEC_TO_TIME(COALESCE(SUM(m.RunTime), 0)) as value
FROM tbl_losscategory l 
LEFT JOIN tbl_machinestatus m ON m.ProcessArea = l.Process AND m.LossCategory = l.Category
WHERE 
 l.Process = 3 
GROUP BY label;

```

But i am getting the below error when i pass the above query as named query to a chart,

```auto
Traceback (most recent call last):
  File "<event:actionPerformed>", line 15, in <module>
com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: java.sql.SQLException: The value '548:59:36' is an invalid TIME value. JDBC Time objects represent a wall-clock time and not a duration as MySQL treats them. If you are treating this type as a duration, consider retrieving this value as a string and dealing with it according to your requirements.

	caused by GatewayException: java.sql.SQLException: The value '548:59:36' is an invalid TIME value. JDBC Time objects represent a wall-clock time and not a duration as MySQL treats them. If you are treating this type as a duration, consider retrieving this value as a string and dealing with it according to your requirements.
	caused by Exception: java.sql.SQLException: The value '548:59:36' is an invalid TIME value. JDBC Time objects represent a wall-clock time and not a duration as MySQL treats them. If you are treating this type as a duration, consider retrieving this value as a string and dealing with it according to your requirements.

Ignition v8.1.25 (b2023021409)
Java: Azul Systems, Inc. 11.0.17

```

It is working fine when i pass the query without converting it into SEC\_TO\_TIME format.  
How to avoid this error and achieve a graph displaying as below,  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/1/3128b54ad9c20f0c99108cf5cd7588ac324a8c02.png)

---

<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 24, 2023, 4:20pm UTC](https://forum.inductiveautomation.com/t/display-duration-as-hhss-in-chart-y-axis/70267/2 "2023-02-24T16:20:54Z")

</div>

You would need to retrieve the value as a _number_, then do the formatting locally in the chart to make our charting system happy.
