Skip to Content
avatar image
Former Member

Subtraction of date columns

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.

Add comment
10|10000 characters needed characters exceeded

  • Former Member

    $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

  • Get RSS Feed

0 Answers