Tag Historian query as child query data source use in Timeseries chart gives date range from 1970-29-01

I am using a basic SQL query as arent and tag Historical query as a child. When I apply the data source obtained from Tag Historical query to Time Series chart I get chart date range from 1970-29-01. It is not taking date from date object created in windows.
On the other hand, if I use the Tag Historian query Datasource without nesting I get the correct result.

Please help.
Thanks in advance.

1 Like

Please show your queries (and scripts, if applicable).

Thanks for your reply.
There are no script used for this.
However I am using simple select statement to to fetch data from table using formatted date range which is coming from vision window (SELECT data 1,data 2,data 3
FROM table
WHERE (data 3 BETWEEN ‘{FormattedStartDate}’ AND ‘{FormattedEndDate}’)
Note: FormattedStartDate = dateFormat({StartDate},‘yyyy-MM-dd HH:mm:ss’).
And Historical query uses tag path to get historical data using standard start time and end time getting from Popup calendar selection object.
Is there any way to pass parameter to historical tag query in nesting?
How can we get column names in historical data table?
I did not got information about Mix and Match data source type in manual etc.

In this scenario I am not passing any parameter from parent to child and using nested to get particular data source structure.

![image|690x399, 50%]

snapshots for reference

Can you check what the query returns when executed in the query browser (you will have to specify the parameters manually).

Note that 1970 is always a very suspicious year. Timestamps are often expressed as seconds or milliseconds starting from 1970 (UNIX epoch). So whenever you have a wrong scaling (like mistake between seconds and milliseconds), or some kind of value that becomes 0 by accident, you arrive close to 1970.

On the screenshot you mention, I see it’s 5 am on 1970-01-01. Is it possible you’re currently at UTC+5? If so, the timestamp returned is the 0 time (so perhaps you got no data?).

Thanks for your input…
If I run query it gives me correct result (Only I am removing Start and End date parameters).
As in nesting ( as mentioned in manuals I am passing column name as parameter {data2} to Tag historical query. Here I am using this parameter to complete tag path given.

Also as mentioned above if I use Tag historical query without nesting I get correct timestamp and result on chart.

Note: I am not getting any examples available online to handle such scenarios (Mix and match Datasources) of nesting SQL and tag Historical query.

Have you found how to solve this issue? I am getting the same strange timestamp values.