X
xnnfan126
Unregistered / Unconfirmed
GUEST, unregistred user!
语句如下:select kesmc,riq,zhiy,banc,zhibr,kaissj,jiessj,kesFQ,(case when substr(jiessj,12,2)='23' then (to_char(to_date(substr(jiessj,1,8)||to_char(to_number(substr(jiessj,9,2))+1)||' 00'||substr(14,6),'yyyy-MM-dd HH24:mi:SS'),'yyyy-MM-dd HH24:mi:SS'))else (to_char(to_date(substr(jiessj,1,11)||to_char(to_number(substr(jiessj,12,2))+1||substr(jiessj,14,6),'yyyy-MM-dd HH24:mi:SS'),'yyyy-MM-dd HH24:mi:SS')) end) yanhsjFrom gzjjb_paibZX where shifmz=0 and '2009-10-20 16:38:24' between kaissj and (case when substr(jiessj,12,2)='23' then (to_char(to_date(substr(jiessj,1,8)||to_char(to_number(substr(jiessj,9,2))+1)||' 00'||substr(14,6),'yyyy-MM-dd HH24:mi:SS'),'yyyy-MM-dd HH24:mi:SS'))else (to_char(to_date(substr(jiessj,1,11)||to_char(to_number(substr(jiessj,12,2))+1||substr(jiessj,14,6),'yyyy-MM-dd HH24:mi:SS'),'yyyy-MM-dd HH24:mi:SS')) end)已知kaissj:='2009-10-20 08:00:00'jiessj:='2009-10-20 18:00:00'出现的问题:ORA-01847:月份中的日必须介于1和当月最后一日值之间可这个问题是偶尔出现一次,但实在是无从下手,无法修改(从语句上看是正确的)