ORA-01841

sql语句如下:

select TranTel,BranCode,SndTimeStamp,RcvTimeStamp from PSFreeMsgReg where 1=1 and  trim(BranCode)  =  ('100001')  and  to_date(AcpDate,'yyyymmdd')  >= to_date('20111208','yyyyMMdd')  and  to_date(AcpDate,'yyyyMMdd')  <=  to_date('20120801','yyyymmdd'),

就报ORA-01841: (full) year must be between -4713 and +9999, and not be ,看语句也没什么问题,让人很郁闷,找了把半天,才发现,对应的AcpDate列,里存在null,或者里面的值不是按照日期格式写的!

你可能感兴趣的:(oracle)