I have two instances of a UDT tag that are the same except the parameter values. One of them works as it should. The other one throws an error on one of the query tags within the instance that pulls data from WonderWare Historian as follows:
Error running query:
SELECT TOP 1 * FROM OPENQUERY(INSQL, 'SELECT DateTime = convert(nvarchar, DateTime, 21), {AirPV} / {AirCV} [BurnerControl_Air], {GasPV} / {GasCV} [BurnerControl_Gas]
FROM WideHistory WHERE wwRetrievalMode = ''Cyclic'' AND wwCycleCount = 1 AND wwVersion = ''Latest'' AND DateTime >= DateAdd(mi,-1,GetDate()) AND DateTime <= GetDate()')
An error occurred while preparing the query "SELECT DateTime = convert(nvarchar, DateTime, 21), {AirPV} / {AirCV} [BurnerControl_Air], {GasPV} / {GasCV} [BurnerControl_Gas]
FROM WideHistory WHERE wwRetrievalMode = 'Cyclic' AND wwCycleCount = 1 AND wwVersion = 'Latest' AND DateTime >= DateAdd(mi,-1,GetDate()) AND DateTime = GetDate()"
for execution against OLE DB provider "INSQL" for linked server "INSQL".
I've confirmed that the QueryParams are correct in both instances and that the data exists in WW Historian.
Thoughts?