michoel
09/06/2023, 7:28 AMBUILTIN.RELATIVE_RANGES
in a SuiteQL criteria, you have probably noticed how poor the performance is. I suspect that there might be an internal function that the query optimizer doesn't cache, resulting in it being called for every line. However, I've found a workaround that gets the engine to calculate the call only once. Hopefully, this will help anyone else facing the same issue.
SELECT id
FROM transaction
INNER JOIN (SELECT BUILTIN.RELATIVE_RANGES('DAGO15', 'START') AS StartDate FROM DUAL) AS RelativeDate ON 1 = 1
WHERE createddate >= RelativeDate.StartDate
The original version looked prettier with a CTE and CROSS JOIN, but I had to find a creative solution to make it work with ODBC.michoel
09/06/2023, 7:28 AMCD
09/06/2023, 8:34 AM