The functionality of some datetime format elements depends on the country and language in which you are using Oracle. For example, these datetime format elements return spelled values: MONTH MON DAY DY BC or AD or B.C. or A.D. AM or PM or A.M or P.M. The language in which these values are returned is specified either explicitly with the initialization parameter NLS_DATE_LANGUAGE or implicitly with the initialization parameter NLS_LANGUAGE. The values returned by the YEAR and SYEAR datetime format elements are always in English. http://gigabase.idi.ntnu.no/oradoc/server.901/a90125/sql_elements4.htm#34926

解决方案 »

  1.   

    http://expert.csdn.net/Expert/topic/2240/2240193.xml?temp=.3734247
    在TO_DATE里这样写好像不行的
      

  2.   

    不会啊,用ORACLE客户端工具生成的也是这样写的呀。
    而且,只要我把AM/PM都删掉就一切正常,只是没法选下午的时间了。
    出错信息里提示需要AM或PM,可是我已经有了,左右匹配的格式也没问题啊
      

  3.   

    select * from my_ckd where ckrq 
    between TO_DATE('1-7-2003 4:00:00 下午','DD-MM-YYYY HH:MI:SS PM') 
    and TO_DATE('1-7-2003 7:00:00 下午', 'DD-MM-YYYY  HH:MI:SS PM');
      

  4.   

    select * from ZAQX where asd 
    between TO_DATE('1-7-2003 4:00:00 下午','DD-MM-YYYY HH:MI:SS PM') 
    and TO_DATE('1-7-2003 7:00:00 下午', 'DD-MM-YYYY  HH:MI:SS PM');
      

  5.   

    或者:
    select * from ZAQX where asd 
    between TO_DATE('1-7-2003 16:00:00','DD-MM-YYYY HH24:MI:SS PM') 
    and TO_DATE('1-7-2003 17:00:00', 'DD-MM-YYYY  HH24:MI:SS PM');
      

  6.   

    ORA-01855 AM/A.M. or PM/P.M. requiredCause: A date specification contained a meridian indicator format code but a valid meridian indicator was not specified. If a meridian indicator code, A.M./P.M. or AM/PM, is included in a date format, the date must include a valid meridian indicator.Action: Specify the meridian indicator in the correct format, A.M./AM or P.M./PM