简体   繁体   中英

SAP HANA SQL FLOAT TO DATE

In SAP I have some dates that are stored in tables as a FLOAT, such as shown below for column ATFLV of table AUSP , which has the value 2.0181218000000000E+07 :

MANDT OBJEK                     ATINN ATZHL MAFID KLART ADZHL ATWRT ATFLV

100   000000000000004148   9999999400   001 O     023    0000       2.0181218000000000E+07

Other example: 在此处输入图像描述

I know these are supposed to be dates, but I can't find a function to transform. I have considered using Add_seconds (assuming the values stored are miliseconds), but I don't know what base date to use 1/1/1900 or 1/1/1970 ?

I appreciate the help.

29.11.2021 EDIT

Just to add some context, I am using HANA DB studio to create a calculation view that does this transformation, using a Table function in HANA SQL.

Thanks to the comments and help from @SandraRossi I have been able to solve my problem using the following:

TO_DATE(LEFT(REPLACE("VALUE_OLD", '.',''),8))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM