# Easy Chart Parts Per Hour

**URL:** <https://forum.inductiveautomation.com/t/easy-chart-parts-per-hour/11656>\
**Category:** Ignition\
**Created:** [May 12, 2016, 4:57pm UTC](https://forum.inductiveautomation.com/t/easy-chart-parts-per-hour/11656 "2016-05-12T16:57:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![boster281](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@boster281](https://forum.inductiveautomation.com/u/boster281)\
**Post date:** [May 12, 2016, 4:57pm UTC](https://forum.inductiveautomation.com/t/easy-chart-parts-per-hour/11656/1 "2016-05-12T16:57:20Z")

</div>

How can i turn the following code into a chart showing the parts per hour on the y and date and hour on the x. I assume i will have to combine date and hour but not sure how.

```auto
SELECT CAST(PartExtractExit as date) AS ForDate,
       DATEPART(hour,PartExtractExit) AS OnHour,
       COUNT(*) AS Totals
FROM [Thermoplastics].[dbo].[MoldingResults]
GROUP BY CAST(PartExtractExit as date),
       DATEPART(hour,PartExtractExit)
```
