# Report time conflict

**URL:** <https://forum.inductiveautomation.com/t/report-time-conflict/22172>\
**Category:** Ignition\
**Created:** [January 28, 2019, 9:20pm UTC](https://forum.inductiveautomation.com/t/report-time-conflict/22172 "2019-01-28T21:20:47Z")\
**Posts on this page:** 5\
**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:** [January 28, 2019, 9:20pm UTC](https://forum.inductiveautomation.com/t/report-time-conflict/22172/1 "2019-01-28T21:20:47Z")

</div>

I am trying to create a report on version 7.9 using a start time and end time i transfer from a table. I keep getting the following error

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/ab801eb3ed98d01156b89545660a30cb57094c59.png)  
This is what I want to run just with the start time and end time swapped out with a parameter. And the following code works  
‘SELECT [key\_ndx]  
,[GE\_Oven]  
,[t\_stamp]  
,[GE\_Duct]  
,[GE\_Oven\_2]  
,datediff(ss,‘2019-01-20 15:00’,t\_stamp) as Diff  
,DATEDIFF(Hour,‘2019-01-20 15:00’, [t\_stamp]) as hourpart,  
DATEDIFF(minute,‘2019-01-20 15:00’, [t\_stamp])%60 as minpart  
FROM Ovens  
WHERE t\_stamp \> ‘2019-01-20 15:00’ AND t\_stamp \< ‘2019-01-28 15:00’  
ORDER BY t\_stamp ASC’

This is the code that creates the error  
‘SELECT [key\_ndx]  
,[GE\_Oven]  
,[t\_stamp]  
,[GE\_Duct]  
,[GE\_Oven\_2]  
,datediff(ss,’{StartDate}’,t\_stamp) as Diff  
,DATEDIFF(Hour,’{StartDate}’, [t\_stamp]) as hourpart,  
DATEDIFF(minute,’{StartDate}’, [t\_stamp])%60 as minpart  
FROM Ovens  
WHERE t\_stamp \> ‘{StartDate}’ AND t\_stamp \< ‘{EndDate}’  
ORDER BY t\_stamp ASC’

Here is the start date expression  
dateFormat(  
dateArithmetic(now(), -120, “hr”), //don’t forget the comma at the end of this line…  
“yyyy-MM-dd HH:mm:ss”) //…as well as the outer closing ‘)’

and the end date  
dateFormat(  
dateArithmetic(now(), -120, “hr”), //don’t forget the comma at the end of this line…  
“yyyy-MM-dd HH:mm:ss”) //…as well as the outer closing ‘)’

I have also tried using tags like the following  
{Machine Status/Cure Oven/Fan StartTime} which is the value I copied to get the times in the to query.

---

<div class="post-metadata">

**Author:** ![nick.schuetz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nick.schuetz/32/6160_2.png) [@nick.schuetz](https://forum.inductiveautomation.com/u/nick.schuetz)\
**Post date:** [January 28, 2019, 10:09pm UTC](https://forum.inductiveautomation.com/t/report-time-conflict/22172/2 "2019-01-28T22:09:09Z")

</div>

The error in the picture shows

```auto
t_stamp '{EndDate}'

```

probably should be

```auto
t_stamp < '{EndDate}'

```

---

<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:** [January 28, 2019, 10:21pm UTC](https://forum.inductiveautomation.com/t/report-time-conflict/22172/3 "2019-01-28T22:21:12Z")

</div>

Thank you, Nick.  
Yea I see what you mean. But I just verified and it is t\_stamp \< ‘{EndDate}’.  
I even tried adding \<= and it only shows the = in the error. But i do still get the error.  
I had also originally tried using a between where clause and had the same error.

---

<div class="post-metadata">

**Author:** ![nick.schuetz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nick.schuetz/32/6160_2.png) [@nick.schuetz](https://forum.inductiveautomation.com/u/nick.schuetz)\
**Post date:** [January 28, 2019, 10:32pm UTC](https://forum.inductiveautomation.com/t/report-time-conflict/22172/4 "2019-01-28T22:32:43Z")

</div>

Try setting the query type to ‘Basic SQL Query’ from the default ‘SQL Query’  
OR use parameterized entries in the ‘SQL Query’  
[https://docs.inductiveautomation.com/display/DOC79/SQL+Query+Data+Source](https://docs.inductiveautomation.com/display/DOC79/SQL+Query+Data+Source)

---

<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:** [January 29, 2019, 3:21pm UTC](https://forum.inductiveautomation.com/t/report-time-conflict/22172/5 "2019-01-29T15:21:17Z")

</div>

That fixed the issue. Thank you.
