Date_part does not works in oracle -
Date_part does not works in oracle -
select date_part('days',date_trunc('month', pr.dateto) '1 month'::interval - date_trunc('month', pr.datefrom) perioddays ht_payreg
this works in postgres,but in oracle not works,please right in oracle.
trunc gives date excluding time portion.
to_char format mask gives different parts of date.
for example,
to_char(sysdate, 'dd') gives today's date 09. to_char(sysdate, 'mon') gives current month oct. to_char(sysdate, 'yyyy') gives current year 2014.
play around different formats. specific output, mention desired output.
look @ datetime format models in documentation here http://docs.oracle.com/cd/e11882_01/server.112/e26088/sql_elements004.htm
oracle
Comments
Post a Comment