Problem with query from historical tag


I am getting an error when i run a query. I want to visualize data from a historical tag in a Boxplot.
I bind the query to the boxplot and i use a daterange for date selection. I dont see what its wrong in the query.

Where tagid = '22' and t_stamp between 

(DATEDIFF(s, '1970-01-01 00:00:00', {Root Container.Date Range.startDate} ) as bigint) * 1000) and (DATEDIFF(s, '1970-01-01 00:00:00', '{Root Container.Date Range.endDate}' ) as bigint) * 1000)  ```

You have a single quote round your end date but not your start date. Check that

I have tried a little and it is working now. Thanks for the reaction.

the right query is

SELECT intvalue FROM sqlt_data_1_2020_04
Where tagid = '22' and t_stamp between

CAST(Datediff(s, '1970-01-01','{Root Container.Date Range.startDate}') AS BIGINT) *1000
CAST(Datediff(s, '1970-01-01','{Root Container.Date Range.endDate}') AS BIGINT) *1000 ```
1 Like