I have this requirement: There is a field of 8-byte length and I want to extract the last 4 bytes using SQL.
Example: There is date 01012017
so I want only 2017
. How can I achieve this using WHERE
clause.
I have this requirement: There is a field of 8-byte length and I want to extract the last 4 bytes using SQL.
Example: There is date 01012017
so I want only 2017
. How can I achieve this using WHERE
clause.
You should select the data in full flesh, then use
LOOP AS it_fulldate ASSIGNING <ls_fulldate>.
<ls_fulldate>-date = <ls_fulldate>-date+4(4).
ENDLOOP.
But usually, date time data type is YYYYMMDD so the correct might be <ls_fulldate>-date+0(4)