extract date only from given timestamp in oracle sql

前端 未结 7 1575
后悔当初
后悔当初 2021-02-13 05:34

The following query:

select cdate from rprt where cdate <= TO_CHAR(sysdate, \'YYYY/MM/DD-HH24-MI-SS-SSSSS\') and ryg=\'R\' and cnum=\'C002\';
<
7条回答
  •  一向
    一向 (楼主)
    2021-02-13 06:18

    This format worked for me, for the mentioned date format i.e. MM/DD/YYYY

    SELECT to_char(query_date,'MM/DD/YYYY') as query_date 
    FROM QMS_INVOICE_TABLE;
    

提交回复
热议问题