Question
Historian DB Thing failed to get the Historian data
I am using ThingWorx Platform Release 9.6
I have a service in my Historian DB Thing to get the Historian data for a PiPoint for a day period from the historian database, when I manually run this service, it always return correct data. this service contains following code: select tag, FORMAT([time],'dd-MMM-yyyy hh:mm:ss.fff tt') time, value, status from piarchive..piinterp2 where tag=[[PIPoint]] AND time >= [[st]] AND time < [[st]] + '+1d' AND time < '*' AND timestep = [[step]] Then I have another service which loop through all PiPoint and load the data for each one and save the data into a SqlServcer database. This service runs every two hours on a schedule and calls the service above to retrieve PiPoint data. The isssue is when the above serivce is called in this service, it works one or two times in a day, while other times it returns 0 rows which I confirmed using logging (there is data in the historian db). The code was never changed since it was implemented last year and it start to fail since early this year.
Here are the errors that I faced
No error message in the script log I can see.
I have a service in my Historian DB Thing to get the Historian data for a PiPoint for a day period from the historian database, when I manually run this service, it always return correct data. this service contains following code: select tag, FORMAT([time],'dd-MMM-yyyy hh:mm:ss.fff tt') time, value, status from piarchive..piinterp2 where tag=[[PIPoint]] AND time >= [[st]] AND time < [[st]] + '+1d' AND time < '*' AND timestep = [[step]] Then I have another service which loop through all PiPoint and load the data for each one and save the data into a SqlServcer database. This service runs every two hours on a schedule and calls the service above to retrieve PiPoint data. The isssue is when the above serivce is called in this service, it works one or two times in a day, while other times it returns 0 rows which I confirmed using logging (there is data in the historian db). The code was never changed since it was implemented last year and it start to fail since early this year.
Here are the errors that I faced
No error message in the script log I can see.

