select * from tablename t where t.endtime>to_date('2008080100:00:00','yyyymmddhh24:mi:ss')上面这个语句错误提示为literal does not match format string能帮忙解答下哪里错了吗?谢谢!

解决方案 »

  1.   

    1、如果edntime 为date类型,则不应该有错。
    2、如果转化 to_char(sysdate -7,'yyyymmddhh24:mi:ss')) 后插入到一个date字段则会报错。你的问题场景描述不清楚,可能性很多。
    ORA-01861 literal does not match format stringCause: Literals in the input must be the same length as literals in the format string (with the exception of leading white space). If the "FX" modifier has been toggled on, the literal must match exactly, with no extra white space.Action: Correct the format string to match the literal.
      

  2.   

    能否贴出表结构和下面语句的输出结果?SELECT * FROM NLS_SESSION_PARAMETERS;
      

  3.   

    select * from tablename t where t.endtime>to_date('2008080100:00:00','yyyymmddhh24:mi:ss') 系统的日期格式,不对
    to_date('2008-08-01 00:00:00','yyyy-mm-dd hh24:mi:ss') 
    可以用select sysdate from dual,查看一下日期的格式设置alter   session   set   nls_date_format='yyyy-mm-dd hh24:mi:ss'
      

  4.   

    两边格式不匹配。
    如果不想查系统格式,不如两边都有to_char来的快。
      

  5.   

    to_date('2008-08-01 00:00:00','yyyy-mm-dd hh24:mi:ss')