My CUBA application is using SQL server at the backend. Now I have this query on SQL server that I want to run on CUBA on one of my datasources:
select * from process where DATEDIFF ( day , GETDATE() , DATEADD(DAY, 70, recepcionedDate)) < 10
Basically what this does is calculate the difference in days between today’s date and the receptionedDate field + 70 days, and return all rows on which this difference is bellow 10 days.
I know I can’t use these functions in JPQL, so I tried using the FUNCTION() operator in JPQL to run the native SQL server function, but it isn’t working.
Can anyone help?
Best regards,
Pedro