bellin124

1、Oracle日期格式ORA-01841: (full) year must be between -4713 and +9999, and not be 0

这种情况基本上就是要格式化的数据是错的

select trunc(starttime)date1,sum(startmainqty) qty 
from rep_wafer_start_detail 
where starttime>=to_date(\'2020-10-10\',\'yyyy-mm-dd\')
and starttime<to_date(\'2020-10-20\',\'yyyy-mm-dd\')
and bg_id=\'ICBG\' group by trunc(starttime)
-------------错误日期更换--------------------
select trunc(starttime)date1,sum(startmainqty) qty 
from rep_wafer_start_detail 
where starttime>=to_date(\'&v_start&\',\'yyyy-mm-dd\')
and starttime<to_date(\'&v_end&\',\'yyyy-mm-dd\')
and bg_id=\'ICBG\' group by trunc(starttime)
--------------正确日期更换(VB)----------------
where starttime>=to_date(\'"&v_start&"\',\'yyyy-mm-dd\') and starttime<to_date(\'"&v_end&"\',\'yyyy-mm-dd\') 

 不是日期格式的数据,原因:

在进行SQL查询时首先以固定时间带入,再在引用程序中更换为变量,更换过程变量格式错误导致日期格式错误

 

分类:

技术点:

相关文章:

  • 2021-12-28
  • 2021-12-18
  • 2021-12-28
  • 2021-11-18
  • 2021-11-18
  • 2021-12-05
  • 2021-12-28
  • 2021-11-19
猜你喜欢
  • 2021-12-28
  • 2021-12-05
  • 2021-12-28
  • 2021-12-05
  • 2021-11-05
  • 2021-12-05
  • 2021-11-05
相关资源
相似解决方案