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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -