0

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.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48

1 Answers1

0

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)

Binh
  • 241
  • 1
  • 15