add

About Me

My photo
Oracle Apps - Techno Functional consultant

Monday, February 18

Date Between and Date Range query



SELECTA.PAYROW_DATE A,A.PAYROW_DATE B FROM (
selectDISTINCT LAST_DAY(TO_DATE('30/SEP/2007','DD/MON/RRRR')+ level) PAYROW_DATE
 fromdual connect by level <(TO_DATE('30/SEP/2012','DD/MON/YYYY')-----Change this Date
 -TO_DATE('30/SEP/2007','DD/MON/YYYY'))
 ORDERBY 1 DESC
 )A


SELECTA.PAYROW_DATE A,A.PAYROW_DATE B FROM (
 selectDISTINCT LAST_DAY(to_date(:start_date,'dd-mon-yyyy')+ rownum -1)PAYROW_DATE
     fromall_objects
    whererownum <=
to_date(:end_date,'dd-mon-yyyy')-to_date(:start_date,'dd-mon-yyyy')+1
 ORDERBY 1 DESC
 )A

No comments: