Skip to Content
0
May 25, 2020 at 02:21 PM

To_Time Error in Table CDHDR

507 Views Last edit May 25, 2020 at 02:22 PM 2 rev

Hello

I am using SAP HANA SQL and my below query giving error on Date and or time conversion (Error as below):

invalid DATE, TIME or TIMESTAMP value: search table error: [6931] exception 70006931: attribute value is not a date or wrong syntax;[here]daydate("UDATE", 'dd.mm.yyyy') -> "__expr0"[daydate], secondtime("UTIME", 'hh:mm:ss'), (UDATE = '20190712'[string], UTIME = '125629'[string])

Table CDHDR has UDATE and UTIME fields and i want to bring it to the output using HANA SQL

please help.

Select

OBJECTCLAS As ChangeObject,

OBJECTID As Object_Value,

CHANGENR As Document_Number,

USERNAME As User,

UDATE As Date,

UTIME As Time,

TO_DATE(UDATE, 'dd.mm.yyyy' ) As DateFormat,

TO_TIME(UTIME, 'hh:mm:ss' ) as TimeFormat

from CDHDR