ITeye博客

ORA-01830: date format picture ends before converting entire

stop_ · 2007-09-17 10:14 · Markdown

sql语句如下:

select        cph
         from   w_chls_hsb_view
       where
      rq_option_b>=to_date('2007/09/16 00:00:00','yyyy.mm.dd') AND rq_option_b<=to_date('2007/09/16 00:00:00','yyyy.mm.dd')

官方文档的回答如下:

Cause: A valid date format picture included extra data. The first part of the format picture was converted into a valid date, but the remaining data was not required.

Action: Check the specifications for date format pictures and correct the statement.

也就是说:

to_date函数的日期部分是一个合法的日期格式,但是包含额外的数据,这部分额外的数据是不需要的。

改成下面的就可以了(把时间去掉):

select        cph
from   w_chls_hsb_view
where
rq_option_b>=to_date('2007/09/16','yyyy.mm.dd') AND rq_option_b<=to_date('2007/09/16','yyyy.mm.dd')

评论(1)

  1. #1 楼 · softor · 2010-11-03 14:52

    时间不能指定具体到日期之后的吗?

评论功能维护中,当前仅展示历史评论。