Hi
I have below code and Time is system is stored as below in Database . I want Documents created in last 5 min from Current Date and Time.. If now is 17:00 than I need documents added from 16:55 till 17:00
Query is in Hana version
14:37
15:36
SELECT
T0."DocDate" "Doc. Date",
T1."Remarks" FROM OWDD T0 inner
join WDD1 T1 on T1."WddCode" = T0."WddCode"
where T1."Status" = 'W'
Thanks
Tuhin PaulPosted Jan 18, 2025, 6:14 AM
Optimized version of the query is :
Why this is more efficient:
Tuhin PaulPosted Jan 18, 2025, 6:12 AM
To retrieve documents that were created in the last 5 minutes from the current date and time in SAP HANA, you need to filter the
DocDatebased on the current system time. In HANA, you can useCURRENT_TIMESTAMPto get the current system time.Sreenath KappoorPosted Jan 16, 2025, 6:05 AM
Hi Ramco,
Add this to the where condition,
T0."DocDate" >= ADD_SECONDS(CURRENT_TIMESTAMP, -300);