oracle11g - How to get data from a table between date and time range -
i have table call payment_det fields payment_date date, payment_time varchar2 , data shown below date format mm/dd/yyyy
payment_date payment_time 2/13/2017 13:03:59 2/13/2017 14:03:59 2/14/2017 01:03:59 2/14/2017 04:03:00
my requirement is, have 2 input dates date time , date time. between given inputs range want details above table.
please suggest me query this.
a simple example out. hope helps.
select * (select 1 col1, '02/13/2017' col2, '13:03:59' col3 dual union select 2 col1, '02/13/2017' col2, '14:03:59' col3 dual union select 3 col1, '02/14/2017' col2, '01:03:59' col3 dual )a to_date(a.col2 ||' ' ||col3,'mm/dd/yyyy hh24:mi:ss') between to_date('01/01/2017 00:00:00','mm/dd/yyyy hh24:mi:ss') , to_date('01/01/2018 00:00:00','mm/dd/yyyy hh24:mi:ss');
Comments
Post a Comment