I am trying to return the max value for a row between 2 predefined time stamps from my DB but I keep getting error out of index.
the named query:
/*SELECT TOP 1 "nCycles_Trex_01","nGoodParts_Trex_01","nCycles_Trex_02","nGoodParts_Trex_02" FROM TrexTest00 WHERE t_stamp <= :date ORDER BY trextest00_ndx DESC
*/
--SELECT MAX 'nCycles_Trex_01',"nGoodParts_Trex_01","nCycles_Trex_02","nGoodParts_Trex_02" FROM TrexTest00 WHERE t_stamp >= :date AND t_stamp <= :date_end
--SELECT :date --AND ADDTIME( ':date' , 20 )
SELECT MAX(nCycles_Trex_01) FROM TrexTest00 WHERE t_stamp >= '2022-6-09 13:59:16' AND t_stamp <= '2022-6-09 13:59:20' --where CONVERT(Time, t_stamp) BETWEEN CONVERT(Time, :date ) and CONVERT(Time, :date_end )
I have tried all those different approaches (every line) but keep getting the error when I try to use the max function. I have 2 dateTime parameters for the corresponding start and end date