Forum Navigation
You need to log in to create posts and topics.

Query - Service Contracts Expiring within 30 days

I am posting this more for the Date function. In MS SQL, we used to be able to use variables like getdate()+30 to add 30 days from today. HANA is more SQL compliant, so some of the shortcuts we used to take, are no longer available.

Here is a great little SAP Business One query I have setup as an alert, that notifies the desired user(s) when Service Contracts are within 30 days of expiration.

SELECT T0."ContractID",
T0."CstmrCode",
T0."CstmrName",
T0."Descriptio",
T0."StartDate",
T0."EndDate"
FROM OCTR T0
WHERE T0."EndDate" >= CURRENT_DATE AND T0."EndDate" < ADD_DAYS(CURRENT_DATE,30)