cancel
Showing results for 
Search instead for 
Did you mean: 

Subtraction of date columns

Former Member
0 Kudos

Hi Team,

I am trying to run below query in HANA SQL analyzer but getting error as "TIMESTAMP is invalid for subtraction operator". Can someone have a look and help in this regard.

SELECT MAX(LST_MODF_TS) MAX_LST_DT, ADD_SECONDS (TO_TIMESTAMP(CURRENT_TIMESTAMP), -(120*60) ) MINUS_2_HOURS, MAX(LST_MODF_TS) - ADD_SECONDS (TO_TIMESTAMP(CURRENT_TIMESTAMP), -(120*60) ) FROM ZSFC_SD.ACTIVITY_TABLE;

Thanks,

Abdulrasheed.

Former Member
0 Kudos

$G_MINUS_2HOURS = '2017.02.14 03:51:01.867000000'

$PREV_QRY_LAST_EXTRACTED_AT = '2015.11.30 08:53:02.000000000'

can we do a subtraction of above to variable values in SAP BODS?

$G_LAST_EXTRACTED_AT = '{$G_MINUS_2HOURS}' - '{$PREV_QRY_LAST_EXTRACTED_AT}';

all three columns are DATETIME columns

Accepted Solutions (0)

Answers (0)