plsql - Cannot get the row using BETWEEN in dates correctly with pl/sql -
i trying return row between '2015/06/15 7:00:00' , '2015/06/15 15:00:00' , exact date of row 2015/06/15 07:32:39 should between 2 dates.
i trying use below:
select * table1 (to_date(to_char(new_time(to_date('1970/01/01 00:00:00', 'yyyy/mm/dd hh24:mi:ss') + (order_date / 86400), 'pst', 'gmt'), 'mm/dd/yyyy'), 'mm/dd/yyyy') > to_date('06152015 07:00:00', 'mmddyyyy hh24:mi:ss') , to_date(to_char(new_time(to_date('1970/01/01 00:00:00', 'yyyy/mm/dd hh24:mi:ss') + (order_date/ 86400), 'pst', 'gmt'), 'mm/dd/yyyy'), 'mm/dd/yyyy') < to_date('06152015 14:00:00', 'mmddyyyy hh24:mi:ss')) i not achieve using above query when change "06152015 07:00:00' "06142015 07:00:00" returns row correctly. can me fix wrong query above?
try this.
new_time(date,'timezone1', 'timezone2') -> convert date timezone1 timezone2
select * table1 new_time(to_date('1970/01/01 00:00:00', 'yyyy/mm/dd hh24:mi:ss') + (order_date / 86400), 'pst', 'gmt') > new_time(to_date('06152015 07:00:00', 'mmddyyyy hh24:mi:ss'), 'pst', 'gmt') , new_time(to_date('1970/01/01 00:00:00', 'yyyy/mm/dd hh24:mi:ss') + (order_date/ 86400), 'pst', 'gmt')
Comments
Post a Comment