日期:2014-05-17  浏览次数:20753 次

!!!在oracle中,用update语句时,日期时间如何处理!!!!
update Sf_Msg_Monthly set smm_Closed_Time=to_date('2011-12-30','yyyy-MM-dd') where smm_Monthlyid = 1
这样可以!!

为什么这样就不行了 
update Sf_Msg_Monthly set smm_Closed_Time=to_date('2011-12-30 11:54:30','yyyy-MM-dd hh24 :mm:ss') where smm_Monthlyid = 1


求解 求等待!!!



------解决方案--------------------
注意下年月日格式yyyy-MM-dd:hh24:mi:ss

SQL code
update Sf_Msg_Monthly set smm_Closed_Time=to_date('2011-12-30 11:54:30','yyyy-MM-dd:hh24:mi:ss') where smm_Monthlyid = 1

------解决方案--------------------
yyyy-MM-dd hh24 :mi:ss
------解决方案--------------------
探讨

lz没看仔细,hh24后面多了一个空格,去掉空格就好了
SQL code
update Sf_Msg_Monthly set smm_Closed_Time=to_date('2011-12-30 11:54:30','yyyy-MM-dd hh24:mm:ss') where smm_Monthlyid = 1

------解决方案--------------------
探讨
引用:

lz没看仔细,hh24后面多了一个空格,去掉空格就好了
SQL code
update Sf_Msg_Monthly set smm_Closed_Time=to_date('2011-12-30 11:54:30','yyyy-MM-dd hh24:mm:ss') where smm_Monthlyid = 1


关于'-'和':'旁边……

------解决方案--------------------
探讨

lz没看仔细,hh24后面多了一个空格,去掉空格就好了
SQL code
update Sf_Msg_Monthly set smm_Closed_Time=to_date('2011-12-30 11:54:30','yyyy-MM-dd hh24:mm:ss') where smm_Monthlyid = 1

------解决方案--------------------
yyyy-MM-dd hh24 :mm:ss oracle并不区分大小写,
但是 分钟是mi ,你的mm 表示 有 月份有50多的,那肯定会报错。