In Oracle, the date conversion Report & quot; the input value is not long enough for the date format & quot; Solution

Source: Internet
Author: User

"The input value is not long enough in the date format" reported in Oracle for date conversion"

[sql] select (select j.jgmc from t_zzjg j where j.jgdm = t.jgdm) jgmc,         t.jgdm,         sum(t.jcj) jcj,         sum(t.sa) sa,         sum(t.la) la,         sum(t.ajbl) ajbl,         sum(t.xsqzcs) xsqzcs,         sum(t.sacw) sacw,         sum(t.jgzx) jgzx,         sum(t.zfgz) zfgz,         sum(t.jjclaj) jjclaj,         sum(t.zs) zs    from t_fxyp_zfycfbtj t   where t.rq between to_date(2013 - 01 - 18   , 'YYYY-MM-DD') and         to_date(2013 - 07 - 18    , 'YYYY-MM-DD')     and exists (select z.jgdm            from t_zzjg z           where (z.dwlx = 'SJ' or z.sjjgdm is null)             and z.jgdm = t.jgdm)   group by t.jgdm   order by t.jgdm  

 

Correct statement
select to_date('2012-05-06 12:05:03','yyyy-mm-dd hh24:mi:ss') from dualselect to_date('2012-05-06','yyyy-mm-dd hh24:mi:ss') from dualselect to_date('2012-05-06','yyyy-mm-dd') from dual

 

This query statement causes this reason because in the to_date () method, the date entered earlier must be enclosed in single quotation marks.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.