find last Monday and Thursday of the year

I use trunc (somedate, 'iyyy') to get the first Monday of the year, but have read messages that suggest that gives you the closest to the beginning of the year Monday.

I need to find the last Monday of the year and also the last Thursday of the year. If the beginning of the year falls on Monday or Thursday, respectively, at the beginning of the year is what I need.

I did extensive testing, but I think that these might get you what you want:

NEXT_DAY(TRUNC(SYSDATE,'YEAR')-7,'THURSDAY')

and

NEXT_DAY(TRUNC(SYSDATE,'YEAR')-7,'MONDAY')

Thursday is the first day of the year in 2009/2015, and Monday is the first day of the year in 2018.

Sample:

SQL> edit
Wrote file sqlplus_buffer.sql

  1  SELECT  NEXT_DAY(TRUNC(SYSDATE,'YEAR')-7,'THURSDAY')    LAST_THURSDAY
  2  ,       NEXT_DAY(TRUNC(SYSDATE,'YEAR')-7,'MONDAY')      LAST_MONDAY
  3* FROM DUAL
SQL> /

LAST_THURSDAY       LAST_MONDAY
------------------- -------------------
01/01/2009 00:00:00 12/29/2008 00:00:00

Published by: Centinul on December 28, 2009 12:20

Tags: Database

Similar Questions

  • My wife and I bought hundreds of iTunes movies and music over the years. I have a terminal illness and won't last long. The account is in my name. How can I ensure that films and the songs that she and I have paid for are accessible for her after I spend

    My wife and I bought hundreds of iTunes movies and music over the years. I have a terminal illness and won't last long. The account is in my name. How can I ensure that films and the songs that she and I have paid for are accessible for her after I die?

    She needs to have your Apple ID and password. Your iCloud ID and the password if you have your own iOS device, so it can have access to these facilities. Even if she wanted to sell, it would need this information to remove the lock of activation before the sale.

  • Bought lightroom and photoshop for the year. But tells me that it will expire.

    Hello I bought photoshop and lightroom for the membership year. a reason any it tells me a count down to my trial expired.

    Log, activation, or connection errors. CS5.5 and later, Acrobat DC

    Mylenium

  • Cannot find subscription that I use for the years

    Hello

    I went on vacation and is home to see my subscription cancelled (new card, I forgot to update). I thought I could just update my card and return to d - sub, but where devil do you have unlimited U.S. / Canada subscription go? I don't see the option available anywhere under subscriptions. Only us or Canada, not both.

    Y at - it link to it, so I can resub? I wouldn't lose it.

    purpletrek wrote:


    Only us or Canada, not both.

    Hello and welcome to the Skype community.

    United States / Canada subscription has been removed [except for current subscribers who maintain their subscription without interruption]. If your subscription has expired, you must now choose either the United States or the Canada.

    TIME ZONE - US EAST. LOCATION - PHILADELPHIA, PA, USA.

    I recommend that you always run the latest version of Skype: Windows & Mac

    If my advice helped to solve your problem, please mark it as a solution to help others.
    Please note that I usually do not respond to unsolicited private Messages. Thank you.

  • Win runing XP two monitors in DualView mode and not remembering the last size and location of the records? How to solve this problem?

    I am running WinXP SP3 with two monitors running in DualView Mode and everything worked as expected until I installed the latest NViDIA drivers.

    After the update of the pilot, all windows and folders open centered on the main display and all pop-up windows from any open window, centered on the secondary display.

    Any changes to the size and the location of the windows and/or files is not saved.

    I searched the Internet for solutions and found nothing.  I tried Microsoft FixIt to the more obvious (said) problem similar to mine and it did not fix the problem.

    I finish the registery fix suggested and it fixed the problem.

    Any suggestions?

    Please notify.

    Roger P. Hendrix

    Hi Roger,

    1. have you tried to uninstall the Nvidia drivers (if you do not want to make install)?

    Follow these steps and check if the problem persists.

    Step 1:

    Uninstall the Nvidia drivers and check if that helps.

    a. Click Start, click Run and then type devmgmt.msc.
    b. right click on my computer and click on manage, and then click Device Manager.
    c. right click on my computer, click Properties and click the Hardware tab, then click Device Manager.
    d. click right Nvidia drivers and uninstall it.

    Step 2:

    Do e restor systemto the point that your computer was working normally and check if that helps.

  • How can I stop Windows Live Messenger issuing alerts every minutes, hours and days of the year? I don't use it.

    I do not use Windows Live Messenger, but he insists on the display of alerts telling me to connect. Why it does this and how can I stop without causing problems in other areas? I know nothing about it except that the people who try to contact me (I guess) can do it without going through channels such as email or telephone.

    I do not use Windows Live Messenger, but he insists on the display of alerts telling me to connect. Why it does this and how can I stop without causing problems in other areas? I know nothing about it except that the people who try to contact me (I guess) can do it without going through channels such as email or telephone.

    I assume you have Windows Live Messenger, because you have installed the Windows Live Essentials.
    If so, a brief explanation...
    Windows Live Essentials includes some programs that can be installed or NOT, must be installed. You can choose whoever you want.

    Now, you have 2 options...

    1. you can disable. He will remain in the system but inactive.

    2. you can purely and simply uninstall it, and it will be out of the system.

    RE: Disable Messenger
    Open MSN Messenger > at the top, click on tools > click Options > column to the left, click on Sign In > straight column, uncheck all boxes > click OK done wnhen.

    RE: Uninstall Messenger

    Start button > in the search box, type programs and features > press the Enter key. Scroll down to Windows Live Essentials > right click it > click on uninstall...
    Follow the guests but be careful to screen > it will ask you what program to uninstall. Select Windows Live Messenger. Follow the prompts.

    You can check out this tutorial:
    http://www.dkszone.NET/uninstall-remove-Windows-Live-Messenger-How-to

  • want to load the elements and first purchased the year last on the new computer

    I bought Photoshop and first items 11 a year ago. Items 11. Am only finding 12 items for download and it does not recognize my serial number. My old computer running Windows xp that is no longer supported. How can I transfer to my my computer?

    Thank you

    You install as you normally.  A downloads for version 11 is available through the following page:

    Download Photoshop Elements products | 11: 10

    Download Premiere Elements products | 11: 10

    If you are having trouble with the serial numbers, which will still be valid, see the following:

    http://helpx.Adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html

    To locate the serial number:

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

    http://helpx.Adobe.com/x-productkb/global/find-serial-number.html

    Error "serial number is not valid for this product". Creative Suite

    http://helpx.Adobe.com/Creative-Suite/KB/error-serial-number-valid-product.html

  • Where can I find toolbar separators and spaces containing the separated my icons?

    I've updated to Firefox 36.0 and I refreshed it was slow in its operation. My toolbars customization, I noticed that the separators and adjustable spaces previously, I had to keep my separated toolbar icons were is no longer included in the charge.
    My question is where can I find them?

    Currently, only available for bookmarks toolbar folder. The separators have been removed in the new user interface that came with Firefox 29, back in April 2014.

    It - https://addons.mozilla.org/en-US/firefox/addon/classicthemerestorer/ - is the only extension I know which supplies separators to other toolbars.

  • student, pricing and graduate before the year end upward

    If I bought a subscription to the student discount, made my account get frozen or if the price increases (if so be aware) if I graduate before the first year is up?

    N °

    Adobe don't know or care when you graduate. They do not follow your academic progress.

    All that is important for Adobe is that you can prove eligibility student when you first sign up for a plan of the student and the teacher.

    Your plan will expire (or be be renewed) after 12 months.

  • Fallout 3 game of the year edition dlc error ps NOT the cant find ordinal error

    I recently bought fallout 3 game of the year edition and fallout 3 has installed on its own very well and I played on it, and got to the last mission and then installed the dlc pack and went the ordinal error installing games for windows live. but now when I try to play the broken steel dlc in closing the game with my saved character it just not normal ending and goes back to the start screen and credits and im not getting all the signals for operation anchorage radio point lookout and mothership zeta of pitt also when I try to connect to windows live on fallout 3 that I connect and I typed in my game key but then he stays on the bar for about 10 seconds and comes with an error message saying something about my connection, and I am in an area where no access to live, but my connection is fine, I can go on the internet (obviously) and I live in England in rugby answer soon Please i BT fallout 3 so much and I can't w8 any longer im going crazy

    Thank you

    Edit: really really need help I confused then I noticed also just after reinstalling DLC thye than afetr I clicked to start the installwizard it takes forever and I can't find all the files on it after it installed so I think that it might be Sumin wrong with the drive but I don't know

    On the application of Fallout 3 Launcher.  Click data files and select from there expansion packs. Paul Smith - MVP for Windows desktop experience... I crawled off NNTP - for now. Detachment Aldershot, United Kingdom. On the internet at windowsresource.net and dasmirnov.net. Please post back to let us know what works and what does not. :-)

  • If someone phones and say u computer year is full of virus and says he can fix at the top of the computer it is scam

    someone who says that they r windows phone and computer of the year is seriously infected and he can fix at the top of the computer if you follow his instructions are this type of scam

    Yes, it is a common scam.

    Do not give them information, do not give them access to your PC and do not go to all the websites that they suggest. One moment. See:

    http://www.microsoft.com/en-gb/security/online-privacy/msname.aspx .

  • With the help of SQL, need to display the previous year, current year and the year next to single variable

    Hi all

    We have an obligation to state the previous year, current year and values of the year next as a LOV in the ADF page.

    This is the query that retrieves the previous year, current year and next year. But the result of this query displays values in 3 columns:

    Select (Extract(year from sysdate)-1), extract (year sysdate), (extract (year sysdate) + 1) twice;

    Output:

    2012 2013 2014


    But I want to display them in a single with 3 rows as column:

    2012

    2013

    2014


    Please your ideas.

    or in the same way

    SELECT EXTRACT (YEAR FROM ADD_MONTHS (SYSDATE, 12 *(LEVEL-2)))

    OF the double

    connect by level<>

  • Sort by date does not account for the year

    When I sort the files by modification date he considers only the month and date. The year is ignored, causing very old files appear on the top, for example

    2007-12-14

    02/10/2010

    2008-09-30

    01/05/2009

    Are you in the files by computer / disk / folder or you use a shortcut to get the file?  Shortcuts sometimes do not function correctly, but it generally works very well if you sort starting with the link to the computer (I have just last week took a thread with the same question, and that is the resolution).

    Click the down arrow next to the update and then click on the Group and it will sort chronologically in groups: maybe the option will work.  Painful modified Date works fine on my system, first for files separately and then for files separately.

    I hope that this workaround works for you.  Otherwise (or you do not like the solution even if it works), after return and we will make a troubleshooting complete diagnosis to try to identify the problem and solve it.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • A Merry Christmas and a happy new year

    A Merry Christmas and a Happy, healthy and prosperous new year to you all the wonderful supporters.  Thank you for your wonderful help and informative over the years, it's very appreciated.

    Thank you

    rachealfromva

    You are welcome. The same thing for you. Merry Christmas.

  • Where can I find Windows Fax and Scan feature in Windows Vista?

    Original title: Windows Fax and Scan function

    I recently installed anHP DeskjetF4400 All in one printer.  When I click Start then all programs I find fax Windows and function in the menu, or anywhere else that I'm waiting for scan. My impressions of the printer and the scans but I can be used only in Windows Live Photo Gallery. I'm not very fimilliar with computers. Is there something that I need to install, I need a software or I'm just using this bad thing

    You have at least the Business Edition? Home Premium does not support it. "A programmer is just a tool that converts the caffeine in code" Deputy CLIP - http://www.winvistaside.de/

Maybe you are looking for

  • Graphics problems in macOS Sierra on Macbook Pro

    I have a 13 "mid-2016 Macbook Pro (model MacbookPro 7.1 - 2.66 GHz/8 GB RAM) I've recently upgraded to Sierra. However, I noticed a slight increase in glitches since the upgrade - serious glitches. For example, the animation for arise Applications ap

  • Why it will not load on LTE

    Just downloaded the iOS for Firefox app. The user interface is simply amazing but the only thing that annoys me is that it will not charge if my phone is not connected to a hotspot or Wi - Fi. If it's on the 3G or LTE it does not load anything. I jus

  • Satellite A210-1AP - Transcend SD HC 16 GB class6 does not

    My laptop does not work with this card.Is there a solution?

  • Driver Bluetooth for HP 15-e041sc (Windows 8.1)

    Hello I have problem with HP laptop 15-e041sc (Windows 8.1). I need driver for bluetooth. \ven_1814&dev_3298&SubSys As almost all the instalation driver http://h10025.www1.HP.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-111157-1&CC=CZ&DLC=CS&LC

  • Aspire E650

    Can this unit be upgraded from Windows XP to Windows 7?