Forum Stats

  • 3,783,311 Users
  • 2,254,756 Discussions
  • 7,880,359 Comments

Discussions

ORA -01722 Invalid number

Goraya
Goraya Member Posts: 7
edited Mar 16, 2020 11:13AM in Social Groups

Hello All,

I am a newbie here. I am looking for some help to resolve an issue with the Oracle SQL query.  I am trying to resolve the invalid Number error for the last three days. Here is the query syntax.

to_char(Trunc(sysdate)+numtodsinterval(DECODE ((( e.actualarrivetime - ( lag(e.actualarrivetime)

OVER (partition by es.evstrname ORDER BY   es.evstrname, e.eta)))),-1, 0,( e.actualarrivetime - ( lag(e.actualarrivetime)

OVER (partition by es.evstrname ORDER BY   es.evstrname, e.eta))),'second'),'hh24:mi'))

I tried to write the same syntax in a different way but no luck. Here is the second syntax:

(TO_CHAR (TRUNC (SYSDATE) + numtodsinterval(DECODE( e.actualdeparttime, -1, 0,  e.actualdeparttime),   'second'),'hh24:mi')-

lag (TO_CHAR (TRUNC (SYSDATE) + numtodsinterval(DECODE( e.actualdeparttime, -1, 0,  e.actualdeparttime),   'second'),'hh24:mi'))

OVER (partition by es.evstrname ORDER BY   es.evstrname, e.eta))

I would appreciate if someone from the community will help me. Thanks

Answers