Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get second Monday of every month in a given date range?

vk1224Feb 7 2014 — edited Feb 10 2014

In Oracle forms, how to get the Second Monday of every month in a given date range?

I've tried below query using WITH Clause, but looks like WITH Clause doesn't work in Oracle forms. So is there any other way to do this in Oracle forms?

WITH   month_range   AS

(

    SELECT  TO_DATE ('Dec 2013', 'Mon YYYY')  AS first_month

    ,       TO_DATE ('Mar 2014', 'Mon YYYY')  AS last_month

    FROM    dual

)

SELECT  NEXT_DAY ( 6 + ADD_MONTHS ( first_month

                                  , LEVEL - 1

                                  )

                 , 'MONDAY'

                 )    AS second_monday

FROM    month_range

CONNECT BY  LEVEL <= 1 + MONTHS_BETWEEN (last_month, first_month)

;

Thanks in Advance.

This post has been answered by AnnEdmund on Feb 10 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2014
Added on Feb 7 2014
7 comments
6,283 views