`
stop_
  • 浏览: 49185 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

ORA-01830: date format picture ends before converting entire

SQL 
阅读更多

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 楼 softor 2010-11-03  
时间不能指定具体到日期之后的吗?

相关推荐

Global site tag (gtag.js) - Google Analytics