---
title: "ORA-01830: date format picture ends before converting entire"
author: "stop_"
date: "2007-09-17T10:14:31Z"
tags: []
slug: "ora-01830-date-format-picture-ends-before-converting-entire"
draft: false
lastmod: "2007-09-17T10:14:31Z"
id: 124653
url: "https://stop.iteye.com/blog/124653"
---

**sql语句如下：**

**select        cph**  
         **from   w\_chls\_hsb\_view**  
       **where**  
      **rq\_option\_b&gt;=to\_date('2007/09/16 00:00:00','yyyy.mm.dd') AND rq\_option\_b&lt;=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&gt;=to\_date('2007/09/16','yyyy.mm.dd') AND rq\_option\_b&lt;=to\_date('2007/09/16','yyyy.mm.dd')]()