Find "the third Friday of the month.

I try to use OPA to generate a set of dates based on a number of different criteria, such as the first of each month, once a fortnight and various others. I'm fighting with that is, as the title suggests. Is it possible under rules for a set of date such as results variables, for example, will be the third Friday of each month?

To be clear, if I enter a start date of July 19, 2011 and I put criteria like the last day of the month, I should be back July 31, 2011, August 31, 2011, September 30, 2011 and so on. (I realized that in a roundabout way, using the functions ExtractMonth, ExtractYear and MakeDate.)

If I go into 19 July 2011, and the criterion is the second Tuesday of each month, I want to on 9 August 2011, September 13, 2011, October 11, 2011. Is there a way that someone can think that this could be done? Without using masses and masses of tables Excel days and dates (which makes the project too large to function properly) I can't find a solution, so any help would be welcome. Thank you.

You can use the functions NextDayOfTheWeek (to get the first Friday) with AddWeeks (to get the third Friday, based on the knowledge the first Friday).

That would give you a single output date based on a single date of entry. If you wanted a timeline of dates (i.e. a temporal attribute), then you should look at using some functions of temporal reasoning as well.

Tags: Oracle Applications

Similar Questions

  • where can I find the monthly subscription?

    where can I find the monthly subscription?

    Hey julietteh55830290,

    Before include files, make sure that they have been converted to PDF format.

    See this KB doc. Document Cloud Help | Adobe PDF package using.

    Kind regards

    Nicos

  • To find the months and days between 2 dates

    Hello

    I want to find the months and days between 2 dates.

    For example.

    1 - Date: August 25, 2013

    2 - Date: October 23, 2013

    If we consider each month 30 days, it should give

    August 25, 2013 to August 30, 2013 = 6 days

    01-Sep-2013-30-Sep-2013 = 1 month

    October 23, 2013 to October 30, 2013 = 8 days

    Total = 1 month and 14 days.

    Kindly help as soon as possible.

    Thanks and greetings

    Suresh

    Assuming that d2 > d1,.

    where d)

    Select sysdate d1, sysdate + 56 double d2

    Union all select to_date (March 1, 2013 ',' dd-mon-yyyy "") d1, to_date (March 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (5 February 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (February 25, 2013 ',' dd-mon-yyyy "") d1, to_date (March 23, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (February 25, 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (August 2, 2013 ',' dd-mon-yyyy "") d1, to_date (29 October 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (February 1, 2013 ',' dd-mon-yyyy "") d1, to_date (May 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (25 August 2013 ',' dd-mon-yyyy "") d1, to_date ('03-Sep-2013', 'Mon-dd-yyyy') d2 double

    Union all select to_date (July 30, 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (August 30, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (3 August 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (3 July 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date ('31-08-2013', ' dd-mm-yyyy'), to_date('05-10-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('31-03-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-03-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-02-2013','dd-mm-yyyy') of the double

    )

    Select d1, d2,

    1 + 30 * trunc (months_between (d2, d1)) + LESS (extract (day of d2), 30)-LESS (excerpt (d1 day), 30)

    + CASE when extracted (d2 day)< extract(day="" from="" d1)="" then="" 30="" else="" 0="" end ="">

    d

    D1 D2 DAYSBETWEEN

    ----------- ----------- -----------

    October 10, 2013 5 December 2013 56

    March 1, 2013 30 March 31, 2013

    5 February 2013 March 31, 2013 56

    February 25, 2013 March 23, 2013 29

    February 25, 2013 March 31, 2013 36

    August 2, 2013 29 October 2013 88

    February 1, 2013 may 31, 2013 120

    August 25, 2013 03 - Sep-2013 9

    July 30, 2013 31 August 31, 2013

    July 31, 2013 August 30, 2013 31

    July 31, 2013 3 August 2013 4

    July 3, 2013 August 31, 2013 58

    31 August 2013 5 October 2013 36

    5 February 2013 March 31, 2013 56

    5 February 2013 March 5, 2013 31

    February 5, 2013 February 5, 2013 1

    In my view, which corresponds to your rules.

  • OBIEE 11 g: how to find the 2nd Friday of the month

    Hello

    How to find the 2nd Friday of the month using the current date in obiee 11g.

    Thanks in advance.

    Kind regards

    MIT.

    Hey MIT,

    You can try with something like this:

    TIMESTAMPADD (SQL_TSI_DAY, TIMESTAMPADD (7 + 6-DAYOFWEEK (TIMESTAMPADD (SQL_TSI_DAY, 1-DAYOFMONTH (CURRENT_DATE), CURRENT_DATE))), (SQL_TSI_DAY, 1-DAYOFMONTH (CURRENT_DATE), CURRENT_DATE))

    It can still be improved to probably avoid transformations 1-2, but at least he does.

    You will need to check what return DAYOFWEEK in your environment for Friday (in mine Friday = 6) as if she does not return to Friday 6, you will need to adjust the formula.

    The idea is to find what day is the first day of the month, since then visit the first Friday (or just stay there if the first day is a Friday). This is done by the DAYOFWEEK 6 (first day of the month).

    And now, you just add more 7 days, so that's why there is a 7 + 6 - DAYOFWEEK (first day of the month) to make it easier to read and understand (instead of 13-...).

  • To find the third Saturday of a month

    Hi all

    Y at - it a simple way to find the third Saturday of each month
    other than two queries below.

    < CODE >

    -The first code (No nested query)
    SELECT MAX (DECODE (LENGTH (TO_CHAR (LEVEL)), 1))
    , TO_DATE (TO_CHAR (SYSDATE, 'YYYYMM') |) '0' || TO_CHAR (LEVEL), 'YYYYMMDD')
    , TO_DATE (TO_CHAR (SYSDATE, 'YYYYMM') |) TO_CHAR (LEVEL), 'YYYYMMDD'))) THIRD_SAT
    OF THE DOUBLE
    WHERE DECODE (LENGTH (TO_CHAR (LEVEL)), 1).
    , TO_CHAR (TO_DATE (TO_CHAR (SYSDATE, 'YYYYMM') |)) '0' || TO_CHAR (LEVEL), 'YYYYMMDD'), "DY")
    , TO_CHAR (TO_DATE (TO_CHAR (SYSDATE, 'YYYYMM') |)) TO_CHAR (LEVEL), 'YYYYMMDD'), "DY")
    ) = 'SAT '.
    CONNECT BY LEVEL < 22


    --deuxieme code (a nested query)
    MAX SELECT THIRD_SAT (ALL_DATES)
    OF (MAX SELECTION (DECODE (LENGTH (TO_CHAR (LEVEL)), 1)))
    , TO_DATE (TO_CHAR (SYSDATE, 'YYYYMM') |) '0' || TO_CHAR (LEVEL), 'YYYYMMDD')
    , TO_DATE (TO_CHAR (SYSDATE, 'YYYYMM') |) TO_CHAR (LEVEL), 'YYYYMMDD'))) ALL_DATES
    OF THE DOUBLE
    CONNECT BY LEVEL < 22
    )
    WHERE TO_CHAR (ALL_DATES, 'DY') = 'SAT '.
    < code >


    Thank you and best regards,
    CDPRASAD

    Hello

    Tubby wrote:

    ME_XE?select next_day(trunc(sysdate, 'MM'), 'SATURDAY') + 14 from dual;
    
    NEXT_DAY(TRUNC(SYSDA
    --------------------
    21-AUG-2010 00 00:00
    
    1 row selected.
    
    Elapsed: 00:00:00.00
    

    Be careful! If the month happens to start Saturday, which returns the 4th Saturday, not the 3rd:

    select  next_day ( trunc ( DATE '2010-05-15'
                    , 'MM'
                    )
              , 'SATURDAY'
              ) + 14
    from      dual;
    
    NEXT_DAY(
    ---------
    22-MAY-10
    

    That's because NEXT_DAY always returns a DATE after (not the same as) its 1st argument.
    Do this instead:

    select  next_day ( trunc ( DATE '2010-05-15'
                    , 'MM'
                    ) + 13
              , 'SATURDAY'
              )           AS third_sat
    from      dual;
    
    THIRD_SAT
    ---------
    15-MAY-10
    

    or, if you need something that is independent of the NLS:

    select  next_day ( trunc ( SYSDATE
                    , 'MM'
                    ) + 13
              , TO_CHAR ( DATE '2010-07-31'     -- You can use any Saturday here
                     , 'Day'
                     )
              )           AS third_sat
    from      dual;
    
    THIRD_SAT
    ---------
    21-AUG-10
    
  • find the 3rd Friday of the month at a given date

    How can 3rd Friday of the month at a given date? I can always spend the first day of the month as input

    for example, the effective date is 1 January 09. need to get the 3rd Saturday 16 January 09 (Jan has 5 Friday 02, 09, 16,23,30)

    entry date: 1 February 09, needed 20 February 09

    Published by: user520824 on April 1st, 2009 12:30

    How about you...

    select trunc(sysdate,'mm') + (6 - to_char(trunc(sysdate,'mm'),'d')) + 14 from dual;
    
    TRUNC(SYS
    ---------
    17-APR-09
    
    select trunc(to_date('01-JAN-09'),'mm') + (6 - to_char(trunc(to_date('01-JAN-09'),'mm'),'d')) + 14 from dual;
    
    TRUNC(TO_
    ---------
    16-JAN-09
    
    select trunc(to_date('01-FEB-09'),'mm') + (6 - to_char(trunc(to_date('01-FEB-09'),'mm'),'d')) + 14 from dual;
    
    TRUNC(TO_
    ---------
    20-FEB-09
    
    select trunc(to_date('01-MAR-09'),'mm') + (6 - to_char(trunc(to_date('01-MAR-09'),'mm'),'d')) + 14 from dual;
    
    TRUNC(TO_
    ---------
    20-MAR-09
    
  • How to view the monthly/annual statistics in terms of time past/calories burned, broken down by each individual activity such as run elliptical/outside etc. Y at - it a third party application that can help me to collect and display these data?

    How to view the monthly/annual statistics in terms of time past/calories burned, broken down by each individual activity such as run elliptical/outside etc. Y at - it a third party application that can help me to collect and display these data?

    Hello

    It is not currently possible to review the data the application integrated in activity or training on this basis. If you want Apple to consider adding this feature, you can suggest here:

    https://www.Apple.com/feedback/watch.html

    However, health and fitness data from other sources, iPhone, and Apple Watch are registered and grouped within the health on iPhone app. These data can be exported, which you may find useful to track the cumulative progress and/or analyze your activity more in detail.

    IPhone app activity also has a button for sharing (top right of the screen) that allows to share data - including social media, Messages, Mail, Notes, and a printer.

    Include third-party applications that can be useful, for example:

    Access to QS

    -"Access your HealthKit data in a table so you can Explorer using numbers, Excel, R, or any other tool compatible CSV."

    - https://itunes.apple.com/gb/app/qs-access/id920297614?mt=8

    SpectaRun workouts

    -"View from the workouts of your Apple Watch on your iPhone and to export these workouts so you can download them to your favorite online running community."

    - https://itunes.apple.com/gb/app/spectarun-workouts/id991723862?mt=8

    Data can also be exported directly from the application of the health (Health Data > All - Share at the top button on the right).

    Check the descriptions and support resources for third party applications for supported details of import and data analysis features.

    More information:

    Use the activity on your Apple Watch - Apple Support

    Use of the workout on your Apple Watch - Apple Support

    http://www.Apple.com/watch/health-and-fitness/

  • Find the first day of the third quarter of next year

    Hello

    I'm writing a sql to find "the first day of the third quarter of the year (from the current year) next»

    I am able to get the first and the last day of the current quarter:

    Select trunc (sysdate, 'Q'), trunc (add_months (sysdate, + 3), 'Q')-1 double

    But, how to find the first day of the third quarter of the year next (from the current year) based on any date entry (i.e. sysdate)

    for example if my entry date = 12/01/2001 should be released 07/01/2015

    If my entry date = 07/04/2005 should be released 07/01/2015

    If my entry date = 20/02/2013 should be released 07/01/2015

    ... etc.

    Thanks in advance

    Hello

    The 1st day of the 3rd quarter of next year is:

    ADD_MONTHS (TRUNC (SYSDATE, 'YEAR')

    18 = 12 + 6

    )

    TRUNC (SYSDATE, 'YEAR') is the 1st day of the 1st quarter of this year

    The first day of the new year is 12 months after that, and the first day of quarter 3 is another 6 months after that.

    user634169 wrote:

    ... But, how to find the first day of the third quarter of the year next (from the current year) based on any date entry (i.e. sysdate)

    for example if my entry date = 12/01/2001 should be released 07/01/2015

    If my entry date = 07/04/2005 should be released 07/01/2015

    If my entry date = 20/02/2013 should be released 07/01/2015

    ... etc.

    Thanks in advance

    You did some errors above?

    If the effective date in 2001, why is the output in 2015, not 2002?

    If the output is based only on the date of the day (currently in 2014), why even mention a start date?

  • I can't find the Firefox I bought several months ago. Are now all Firefox for Windows for free?

    I bought Firefox several months ago. I need to reinstall the version of Firefox, but I am unable to find the paid version of Firefox. I wonder if there is still a paid version of this product or not. Also, I created an account when I bought this article several months ago. I just need to figure out if there is a paid version of this product stll and if there is, how to find it.

    You must still download and install Firefox from the official Mozilla servers to avoid unwanted extras like malware.

    You can find the full version of the current Firefox version current (39.0) in all languages and all systems operating here:

  • How to find the serial number of the processor in the MacBook pro s serial number? I have a dead MacBook that was given for service to a third party. I doubt that they have replaced the original parts. Help, please. Thank you

    How to find the serial number of the processor in the MacBook pro s serial number? I have a dead MacBook that was given for service to a third party. I doubt that they have replaced the original parts. Help, please. Thank you

    As far as I KNOW, the serial number of the MacBook does not have the serial number of the processor.

  • Nomination for the third Wednesday of each month

    How can I set up my monthly calendar to an event that occurs every third Wednesday of the month?  Thank you.

    Hello

    • You use windows calendar or any other program?

    If sa is the Windows Calendar, then it is not possible to do.

    http://Windows.Microsoft.com/en-us/Windows-Vista/customize-Windows-Calendar

    Diana

    Microsoft Answers Support Engineer

  • Find the 2nd Sunday of each month in a report

    Hello

    I have the data of EMP_Name and Join_Date. I have to build a dashboard report where

    1. In the dashboard, there is a command prompt. If I select a year and a month then, the report is expected to show that the data of the respective month.
    2. This report will show the employees who joined the company only after the 2nd Sunday of each month until the end of the month.

    Inputs/suggestions, how to build it?

    Thanks in advance.

    You have a question, Yes... a SQL query... OBIEE do not mean SQL but LSQL, your query will be not really usable like this...

    You're right, it seems that when the first day of the month is a Saturday he jump 1 week...

    The correct formula for the 3rd Friday is:

    TIMESTAMPADD (SQL_TSI_DAY, (14 + 6-CASE WHEN DAYOFWEEK (TIMESTAMPADD (SQL_TSI_DAY, 1-DAYOFMONTH (CURRENT_DATE), CURRENT_DATE)) = 7 THEN 0 END ELSE DAYOFWEEK (TIMESTAMPADD (SQL_TSI_DAY, 1-DAYOFMONTH (CURRENT_DATE), CURRENT_DATE))), TIMESTAMPADD (SQL_TSI_DAY, 1-DAYOFMONTH (CURRENT_DATE), CURRENT_DATE))

    If instead of CURRENT_DATE you want to use your own column date just to replace in the formula and it works.

  • How to find the first day of the month following two years one year from now?

    Hello

    I need to find the first day of the month following two years ago, based on the current date.

    For example: If today is the 31/08/2015 so I need to find the date range between 31/08/2015 and on 09/01/2013. How can I write an SQL which allows to automate this calculation instead of hard-coding the values. Please do help me out with this so that I can build the SQL that can produce the desired result.

    Thank you

    Dhilip

    find the start of the month - 2 years in advance, early - 2 years + 1 months in advance and go back 1

    Select trunc (add_months(sysdate,24), 'MM'), trunc (add_months(sysdate,25), 'MM') - 1 double;

  • How to find the first Sunday and the second Saturday of each month

    Hi all

    How to find the first Sunday and the second Saturday of each month

    Thank you

    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production

    994122 wrote:

    Hello

    I need to pass the months parameter how to do this? like Jan, Feb etc... (one of those)

    Do you have a procedure?

    Should you output only for the months you passed in the parameter?

    The easiest way is to set the parameter as date. When you go such as p_date as DATE ' 2014-10-01', then you can

    PROCEDURE two_dates)

    p_date IN DATE

    p_first_sunday DATE

    p_second_saturday DATE

    )

    IS

    BEGIN

    p_first_sunday: = NEXT_DAY (TRUNC (p_date, 'MM') - 1, TO_CHAR (DATE ' 2014-10-12', 'DAY'));

    p_second_saturday: = NEXT_DAY (TRUNC (p_date, 'MM') - 1, TO_CHAR (DATE ' 2014-10-11', 'DAY')) + 7;

    END two_dates;

    Or you describe what you need.

  • Lightroom works only with reduced funktionality. Develop module is not available.  Adobe can not find the license associated with my Adobe why identification code? Every month I pay an amount for PS and LR...

    After the upgrade to Windows 10 Lightroom works only with reduced funktionality. Develop module is not available.  Adobe can not find the license associated with my Adobe why identification code? I bought the license more than 1 year ago. Every month I pay an amount for PS and LR, and for the past 4 months I can't work. Russian support team cannot solve this problem and sent me here.

    Thank you! I reset my password, the problem was in it.

Maybe you are looking for

  • Problem with upgrade RAM of DC7700

    Good morning guys, I have a problem with my HP DC7700... I need to improve the RAM and I bought a stick of 1 GB RAM... When I put it on the motherboard to the start with the power button, do not start BIOS! She do 5 beeps, what I have to do for this

  • Windows Vista failed to check the updates, error 80070490, did he ran but the problem persists

    KB2679255 & KB2676562 installation problems. Look for day, but Windows Vista Impossible answer updates check updates, error code 80070490. Other updates to Windows Installer. Ran he made but problems persists.

  • Acer aspire 5740-6378 will no longer charge the battery under Windows 7

    The title sums it up.  I have a new computer that beginning yesterday will not charge the battery.  I didn't have problems with battery or power systems before that. * original title - (sector, do not load) with 21% of battery. It has been so for 24

  • cannot print Please help!

    OK, so I use windows vista 64 bit and I bought the deskjet f4480 today. I installed it like the instructions said and it seemed to install correctly. I did the alignment test and all is good. Hey well when I go to print something nothing happens... H

  • Uninstalling (Windows) key signing

    I had problems connecting my app BB10. The app is an application of webworks. I am currently using BB10 WebWorks SDK 1.0.2.9. I had a few signature keys installed on this computer before and a few other SDKs. Given that I uninstalled all older SDKs t