1. 程式人生 > >ORA-01830: date format picture ends before converting entire input string

ORA-01830: date format picture ends before converting entire input string

這個錯誤是日期格式化的問題;

例子:

SELECT
	COUNT (*) AS col_0_0_
FROM
	SAF_T_PREPLAN_DRILL saftprepla0_
WHERE
	saftprepla0_.DEL_FLAG = '0'
AND saftprepla0_.MAIN_DEPT ='0100'
AND saftprepla0_.PLAN_TIME >= TO_DATE ('2018-01-01', 'yyyy-MM')
AND saftprepla0_.PLAN_TIME <= TO_DATE ('2018-11-1', 'yyyy-MM')

format的資料型別和所要查詢的資料型別並不一致。