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
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.