TO_DATE ISO year and ISO week

Hello

I have a character-string '0949' which is the year of the Iso and the Iso week.
To get this string, I use this code:
to_char (trunc (sysdate, 'IW'), 'IYIW')
Is it possible to convert this string to a date?
I tried with this code:
to_date ('0949', 'IYIW')
but only get an error ORA-01820.
WITH data AS (SELECT 0749 iwiy FROM dual)
    ,separated AS (SELECT to_date(substr(to_char(iwiy,'fm0000'),-2),'YY') AS yy
                         ,to_number(substr(to_char(iwiy,'fm0000'),1,2)) iw FROM data)
SELECT trunc(yy,'IY') + (iw-1) * 7
 FROM separated
/

I hope this helps...

Roger

Tags: Database

Similar Questions

  • Convergence 2u5 - how to get the ISO week number in calendar view?

    Hello

    Convergence seems to be displaying week numbers "US Standard" (e.g. 27/02/2013 is week 8).
    I don't see any option to display European/ISO week numbers (27/02/2013 is week * 9 *).

    You can test on this page: http://www.onlineconversion.com/day_week_number.htm

    Tested with 2u5 and Convergence 2u4.

    Technically, Convergence depends currently dojo to calculate WeekNumber (kernel.js called dojo.date.locale.format that calls dojo.date.locale._getWeekOfYear which uses US Standard).
    The dojox.date.posix.getIsoWeekOfYear method can be called to get the ISO week number.

    EDIT: ok, known problem.
    https://support.Oracle.com/epmos/faces/UI/km/BugDisplay.JSPX?ID=15920988

    And:
    https://support.Oracle.com/epmos/faces/UI/km/SearchDocDisplay.JSPX?_afrLoop=358252901368927 & type = document & ID = 1508601.1 & DisplayIndex = 1 & _afrWindowMode = 0 & _adf. CTRL-State = hy91faqhm_93

    Published by: user13722792 on 27 Feb. 2013 02:03

    Yes, we talk about behavior. However, demand for next development was opened on this:

    15920988 DO WEEK NUMBERING CUSTOMIZABLE IN CONVERGENCE

    More on that we can read in the document of knowledge:
    The numbering of the week in the calendar week view is inconsistent with the ISO8601 (Doc ID [1508601.1 | https://support.oracle.com/rs?type=doc&id=1508601.1])

    It also contains a customization to get Convergence use week numbering.

    If you want to be officially added to the demand of development, you need to open a Service request, which contains this application.

    Cheers, Ben

  • Windows Update updates reported ever installed on my computer 2 years and enjoyed when they are made every day?

    June 11 automatic check for the updates ran and said 15 updates are available, up-to-date and insalled, following restart, section to update the system in red and said that no update was already installed! Computer over 2 years and the system is configured to automatically check every day. Updates have always been installed regularly. Additional information - last week I installed microsoft office 2007 student edition. What happened to my computer, because it is not good. Where is my update history?

    Windows Update Forum:

    It's updated operating system Vista, upgraded installation and activate Forum.

    You will get the best help for any problem of Update/Service Pack in the Windows Update Forum; the link below:

    http://social.answers.Microsoft.com/forums/en-us/vistawu/threads

    When you repost here, kindly include the Error Codes, and exactly what is happening when you try to update.

    In this way, you will receive the best help.

    See you soon.

    Mick Murphy - Microsoft partner

  • My DV7 series laptop for a year and a half old keeps freezing while charging.

    So Ive had this laptop (chart below) for about a year and a half now, and last week he suddenly started freezing only while it loads. It happens regardless of the temperature, my graphic choice (radeon or intel) and any other factor. When this happens, I can still move my mouse to the screen, but everything else is frozen (bar tasks will not fall down as normal, background turn, monitor cpu is not update. im not very experienced in solving a problem like this, but I don't know my way around my PC so I can easily get the necessary additional info.)

    Data sheet: HP Pavilion dv7-4285dx Entertainment Notebook PC

    Intel core i5m460

    6 GB of ram

    graphics Intel HD and Radeon HD 6370 (these are switched using catalyst control center, if it matters)

    Thanks in advance guys, I appreciate any help you may have

    Temperatures are good and I will await the outcome of memtest.

    The only problem I see is AVG.

    AVG is that a virus scanner which often gives trouble.

    Why? It is not the best antivirus and gives wrong with HijackThis.

    HijackThis is a tool of advanced securety used by malware specialists. And AVG is not the complete package.

    Yust a assume that you use the Windows Firewall? If Yes this isn't good eunogh for threats.

    Another assumption:

    You do not run on Java 8.

    Please uninstall all versions of java and download this new version.

    http://jdk8.Java.NET/Download.html

    I recommend Avast 7 free + free Online Armor + Secunia PSI 3.0 and Java 8

    If you plan to install Avast it please let me know. You will need to disable something in Avast, otherwise there will be trouble with Online armor free.

    Oh and by the way, good luck in school.

    And I am currently in the + time zone gmt Schedule 1 so it is possible that my answer comes at an odd time.

    Drunks

  • I bought the Photoshop product for a year and spent a month and my product does not work.

    I bought the Photoshop product for a year and spent a month and my product does not work. reason why its not not a money from my card? I wrote the details of two my maps. It is played automatically? I hope I could understand my problem to you. Thank you!

    During the work week...

    To the link below, click on the still need help? option in the blue box below and choose the option to chat or by phone...

    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If it fails to connect, try to use another browser.

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html ( http://adobe.ly/19llvMN )

  • I have been using InDesign for many years. Last week I suddenly discovered that I couldn't open a document by double-clicking on the desktop or wherever it was. Instead, I now find the document in some folder that is, click on it once, t

    I have been using InDesign for many years. Last week I suddenly discovered that I couldn't open a document by double-clicking on the desktop or wherever it was. Instead, now I have to find the document in the folder it's in, click on it once, and then click file in the bar at the top of the screen, go to open, then it will be open. Any ideas why this happened all of a sudden? In addition, in the bar on the top of a document, I can no longer change the Essentials to advanced or others. Seems to have everything that happened at the same time. Help appreciated please.

    First of all: this has nothing to do with InDesign, it has to do with your OS, so second: what operating system? Windows or Mac because to solve this problem, we need to know which. It's your operating system which has lost the connection with your program and document files.

  • first day of the year and Monday next year

    Hello all;

    Given a year, how to determine the first day of this year and the next two Mondays for this year...

    This gives a shot:

    SELECT TRUNC(TO_DATE('2010','YYYY'),'YEAR')                        AS first_day_of_year
         , NEXT_DAY(TRUNC(TO_DATE('2010','YYYY'),'YEAR')-1,'MONDAY')   AS first_monday_of_year
         , NEXT_DAY(TRUNC(TO_DATE('2010','YYYY'),'YEAR')-1,'MONDAY')+7 AS second_monday_of_year
    FROM   dual
    ;
    
  • HELP: My Macbook Pro tells the bad year and date!

    It's horrible. I am a user of Macbook Pro of Israel. The current date SHOULD be September 1, 2016, but that's what I get for some reason any. It was good but I messed up it somehow and I tried over and over again but I can not change the year and date! It says 28 AV 5776 instead of September 1, 2016. PLEASE SAVE ME!

    what I mean:

    Go to System Preferences > region and language and make sure that the calendar is set to Gregorian

  • can you help to reset the iPhone 6 +? used of the year and the month. Now, when you update, it asks activation and I can't remember anything! Arouca and verification is in stock

    can you help to reset the iPhone 6 +? used of the year and the month. Now, when you update, it asks activation and I can't remember anything! Arouca and verification is in stock

    To activate you need your Apple ID and password. If you forgot their date on https://iforgot.apple.com.

  • Why my display of the date of the mailbox does not have a / between the year and the month?

    I'm talking here about how the date of different e-mails appear in my Inbox. I have a / between the month and the day, and a / after the day, but I did not / between the year and the month.

    TB uses the date format short, such that defined by your operating system, which, in the case of Windows, is located in the Panel control/region and language.

    http://KB.mozillazine.org/Date_display_format

    There are a few modules that might also be useful:

    https://addons.Mozilla.org/en-us/Thunderbird/addon/ConfigDate/

    https://addons.Mozilla.org/en-us/Thunderbird/addon/Super-date-format/

    http://chrisramsden.vfast.co.UK/3_How_to_install_Add-ons_in_Thunderbird.html

  • How to export pictures / albums of iPhotos to external disk and keep the time/date/year and location information changed?

    How to export pictures / albums of iPhotos to external disk and keep the time/date/year and location information changed?

    Menu, file == > export - check boxes to include metadata and location- export to iPhoto

    LN

  • I worked on a large document for several years and all of a sudden I can't scroll to the bottom of the screen with my two fingers on the touchpad, well that I have no problem scrolling to the bottom of this page to search for similar issues.

    I worked on a large document for several years and all of a sudden I can't scroll to the bottom of the screen with my two fingers on the touchpad, well that I have no problem scrolling to the bottom of this page to search for similar issues. I can navigate only to go up and down with the arrow keys.

    What version of Pages is running on your MBP?

    What version of Mac OS X is running on your MBP?

    The MBP is not iOS running.

  • Windows 7 not genuine after a year and a half?

    I bought my toshiba in nov 2009 and it works perfectly well for a year and 9 months, but after an update I get suddenly a windows isn't genuine pop, the key is one that I had with my laptop but he repeats to me is not the correct key. I've never had this kind of problem before so I don't know what to do.

    Can anyone help?

    Hello

    What version of Windows 7 you are using? Did you install a new copy of Windows 7 on this laptop?

    Generally, the laptop has been preloaded with Toshiba picture and the Windows operating system is already activated

    If the key at the bottom of the unit belongs to the Toshiba Windows preinstalled operating system and cannot be used to activate the Windows operating system once more

  • dates of collections difficult. years and times are good.

    I just imported all my photos in the form of files referenced in the Photos. Some of the photos had been imported originally using iphoto, some with opening and with lightroom. All those iPhoto and aperture had been exported as originals for my photos folder. They live outside the original iphoto and aperture libraries managed.  Everything goes well except a few dates in the collections view are wrong. I checked the dates in my lightroom catalog (I have all imported as well) and they are all correct. In the years and moments all dates seem to be correct. It's very frustrating because I prefer the opinion of collections, but some of them are out of sync as much as 6 years. Is there a way to fix this?

    One of the problem photos open in preview and check the EXIF date (or use Simple EXIF viewer - http://www.tucows.com/preview/1103787/Simple-EXIF-Viewer-For-Mac-OS-X )-I expect to deceive but check it out

    and note that references libraries are not a good idea with Photos - Photos doesn't have the right tools to work with the referenced libraries and they are problems - and have no advantage (see this thing on iPhoto- iPhoto and file management - is the same for Photos) and it was even reported that they take more space in the photo library as the copy of the photos in a managed library

    LN

  • I got my iphone 6 more for about 1 year and camera view is too blurry can I go and ask to fix n the apple store for free?

    I got my iphone 6plus ios 9.1.2 for about 1 year and the camera view is too blurry, can I go and ask difficulty nto iphone store for free?

    This is a user to user forum. You can ask your question to Apple.

Maybe you are looking for