Skip to Content
0

Subtraction of date columns

Feb 10, 2017 at 04:04 PM

65

avatar image

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.

10 |10000 characters needed characters left characters exceeded

$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

0
* Please Login or Register to Answer, Follow or Comment.

0 Answers