VTSCADA manual shows ODBC SQL query to access VTScada data from an external application like PowerBI, Python etc with explicit timestamp. e.g.,
SELECT Timestamp, 'ModDriver1:ErrorValue' from History
WHERE Timestamp BETWEEN '2014-03-01 16:54:00' AND '2014-03-01
16:55:00'
I need to write query using relative time without using explicit hard coded timestamp. i.e. timestamp between last 1 hour or last 1 day etc. Could someone please advise on the appropriate VTSCADA syntax to implement relative time references instead of explicit time in this context? I have tried a bunch of things with and without quotes like, NOW()-1D, TODAY()-1D, sysdate()-1D, systime()-1D, systimestamp-1D, GETDATE()-1D etc. But yet to make anything work. Relative time query should be a basic ask for any ODBC driver. So I must be missing something.
VTSCADA manual shows ODBC SQL query to access VTScada data from an external application like PowerBI, Python etc with explicit timestamp. e.g.,
````
SELECT Timestamp, 'ModDriver1:ErrorValue' from History
WHERE Timestamp BETWEEN '2014-03-01 16:54:00' AND '2014-03-01
16:55:00'
````
I need to write query using relative time without using explicit hard coded timestamp. i.e. **timestamp between last 1 hour or last 1 day** etc. Could someone please advise on the appropriate VTSCADA syntax to implement relative time references instead of explicit time in this context? I have tried a bunch of things with and without quotes like, **NOW()-1D, TODAY()-1D, sysdate()-1D, systime()-1D, systimestamp-1D, GETDATE()-1D** etc. But yet to make anything work. Relative time query should be a basic ask for any ODBC driver. So I must be missing something.