start/end date and time in oracle sql query -
i need query output below table; primary entry table , these records modified third party program have no control. can suggest sample?
id | datein | dateout | status 1 02.02.2014 00:00:00 02.02.2014 23:59:59 1 2 03.02.2014 00:00:00 03.02.2014 23:59:59 0
i tried
select to_char(to_date(sysdate), 'dd-mm-yyyy hh:mm:ss pm'), to_char(date_add(to_date(sysdate +1), interval -1 second), 'dd-mm-yyyy hh:mm:ss pm') dual
but query throws error ora-00907: missing right parenthesis
.
there no need pm
if want in 24-hour format. , pay attention mask minutes, mi
, not mm
in query. mentioned no need convert sysdate
date of datatype:
select to_char(to_date(sysdate), 'dd-mm-yyyy hh24:mi:ss') date_in, to_char(to_date(sysdate + 1) - interval '1' second, 'dd-mm-yyyy hh24:mi:ss') date_out dual; date_in date_out ------------------- ------------------- 11-03-2014 00:00:00 11-03-2014 23:59:59
Comments
Post a Comment