Friday, 4 December 2020

Oracle SQL + How to concatenate time to a date

0 comments

1). select to_date ('17-Feb-2019' || ' 23:59:00', 'dd-mon-yyyy hh24:mi:ss') from dual;

2). If you're passing a DATE variable and a STRING below query should works

select to_date ( to_char(DATE_VARIABLE, 'dd-mon-yyyy') || ' 23:59:00', 'dd-mon-yyyy hh24:mi:ss') from( select to_date('17-Feb-2019', 'dd-mon-yyyy') as DATE_VARIABLE   from dual);

Thanks

Amar Alam