oracle10g - extract date only from given timestamp in oracle sql -


the following query:

select cdate rprt cdate <= to_char(sysdate, 'yyyy/mm/dd-hh24-mi-ss-sssss') , ryg='r' , cnum='c002'; 

return: 2013/04/27-10:06:26:794 stored in table.

i want date : 27-04-2013 , number of days between resul tdate , sysdate.

use function cast() convert timestamp date

select to_char(cast(sysdate date),'dd-mm-yyyy') dual; 

for more info of function cast oracle11g http://docs.oracle.com/cd/b28359_01/server.111/b28286/functions016.htm#sqlrf51256


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -