Really Simple Date conversion function... but does not work

For my application, I need a function that converts a date in a date that is a Monday.

I wrote this simple function and I tried for many times... but it just doesn't work. It returns a null value. The problem lies in the IF statement.

I'm using iSQL 9
CREATE OR REPLACE FUNCTION to_monday ( datum IN DATE )
  RETURN DATE
  AS
BEGIN
  FOR n IN 0..6 LOOP
    IF ( TO_CHAR(datum + n, 'day') = 'friday' ) THEN
      RETURN (datum + n - 4);
    END IF;
  END LOOP;
END;
SELECT to_monday(CURRENT_DATE) FROM dual;
Published by: popovitsj on 2012-mrt-11 05:07

Published by: popovitsj on 2012-mrt-11 05:09

Published by: popovitsj on 2012-mrt-11 05:09

Published by: popovitsj on 2012-mrt-11 05:12

It is already available.

SQL> select next_day(sysdate,'monday') a from dual;

A
---------
12-MAR-12

Tags: Database

Similar Questions

  • Satellite A200-1 and Windows 7 problem - function button does not work

    I have computer does model no A200-1The and windows Vista for windows 7 32-bit, I changed a moment my function button does not work.

    What should I do now? Maybe someone greet me some player? Please help me I can use my driver.

    Do you mean the FN key or what?
    > Please help me I can use my driver.
    My English is also not the best but what do you mean with driver?

  • Satellite A350-13 a - function keys does not work

    I have the Satellite A350-13. I installed Windows 7 for 2 weeks.

    The function keys does not work although I have installed the Toshiba value added package, which is responsible for the activation of the function keys.

    What the solution to this problem?

    > Function keys does not work although I have installed the toshiba value added package, which is responsible for the activation of the function keys

    Next to the VAP (value added package) you need to install the Flash Utility card support!
    Card Flash utility support controls the keys FN and not the VAP! But VAP is also needed.

    Good bye

  • HP AC 15-AC122TU: my function key does not work!

    Hi, my function key does not work which is the reason why I could not increase or decrease the volume, brightness etc. I already saw some videos and tried to disable from BIOS. But it's not always works. Can you please suggest any driver for it.

    Hi @soumyajit1991,

    Welcome to the HP Forums! I read your post and wanted to help.

    I understand that the function keys on your laptop is not working. Please try to re - install the HP System event utility: sp76383.exe

    Let me know if it helps.

    If this helps you to find a solution, please click on the button "Accept as Solution" down below in this message. If you want to say 'Thank you' to my effort to help, click on the "thumbs up" to give me congratulations.

    Kind regards

  • JavaScript works with an alert, but does not work without it. Why?

    This happened to me before, but I was able to solve my problem. Now I'm not.

    Let me explain: I have a javascript function which I call when I double click on a line on a table:

    [code]

    function CallServ (evt) {}
    source var = evt.getSource ();

    AdfCustomEvent.queue (source, "call",
    {
    },

    (false);

    auxDblClick.call (this, source);
    }

    function auxDblClick (CBC) {}
    split var = src.toString () .split ('=');
    var idButton = split [1];
    var split2 = idButton.split(':');
    okButton = split2 var [0].concat(':');
    for (var i = 1; i & lt; (split2.length - 1); i ++) {}
    okButton = okButton.concat (split2 [i], ' :');)
    }
    okButton = okButton.concat ('dc_cb1');
    var comp = AdfPage.PAGE.findComponent (okButton);
    Alert (COMP);
    AdfActionEvent.queue (comp, comp.getPartialSubmit ());

    }

    [/ code]

    As you can see, my alert line is commented. If it is not commented, the "auxDblClick" feature works very well: it will print the model on the alert, and then it will perform the action of the dc_cb1 button. However, when I commented the alert function, it stops working.

    I have PartialTrigger set to "true" on my dc_cb1 button and the clientComponent is set to 'true '. I've also set to true ClientComponent on the table, but it does not work.

    So, why the function working with alert, but does not work with the alert off the coast? What Miss me?


    P.S: jdev version 11.1.2.4.0

    I found the solution:

    Before the "AdfActionEvent.queue (comp, comp.getPartialSubmit ());" line, I used the update function. Like this:

          var t = document.getElementById (okButton);
       
          t.Focus ();

    Now everything works fine

  • F4 function key does not work does not in Excel 2010

    I have a HP Pavilion series g - Windows 7-64 bit

    The F4 function key does not work in (2010 excel 64-bit).

    Any suggestions?

    ch1616

    Hello

    It may be useful to change the setting of the fn key in the bios as described in the link below to see if this has an effect on the f4 key in Excel.

    http://support.HP.com/us-en/document/c02035108

    Kind regards

    DP - K

  • When I try to buy a book, it seems it download but does not work. If I am able to get a sample and try to buy the sample goes far & no new book. There are funds in my account iTunes Help!

    When I try to buy a book, it seems it download but does not work. If I am able to get a sample & try to buy the sample goes far & no new book. There are funds in my account iTunes Help!

    Mine just did the same thing. I've even went and was sold again in case I did something wrong the first time. Still no book! I had to happen a few weeks ago, but when I closed iBooks and reopened, the book was there. This time that didn't happen.  I prefer to read on the iBook, but I'm not if my books download

  • HP Simple pass Manager 6.0 does not work in Firefox 30

    I have been using HP Simple pass Manager 6.0 almost the entire Bill by paying websites. Recently my Firefox browser set to update Firefox 29 to 30 of Firefox. Now my HP Simple pass Manager 6.0 does not work in Firefox 30 in all.

    I contacted Mozilla Firefox and they said it's you plugin to increase the power of the fix. Is there a plugin fix soon?

    I rely on this program for extra protection.

    Thank you

    Chief

    Chief,

    Downgrade to the version of Firefox prior to Version 30 to allow the HP SimplePass extension to work.

    The instructions are below.

    The downgrade of the browser can disrupt the HP SimplePass database.  In fact roughly about everything upsets the HP SimplePass database.  The smile.

    Archives of Firefox

    Example: 26.0 for Windows download version (using a slightly different path for Mac)
    https://FTP.Mozilla.org/pub/mozilla.org/Firefox/releases/26.0/win32/en-us/

    ===========================================================================

    You can overload well enough, that is, install the old version of Firefox on the top of your new version.

    To be sure, export your bookmarks before making any changes in case something weird.

    Continue:

    • Close all your programs and shut down your computer
    • Unplug everything (little unifying for the keyboard / mouse external can stay)
    • Perform the Hard Reset for your model of laptop
    • Start the computer and connect

    Reminder: Hard Reset is just a device to reset.  The procedure do not destroy your files, or it destroys your Windows installation somehow.  It's just "clears the cobwebs".  Depending on the cause of the problem, this kind of "reset" can fix a variety of computer problems.

    If no joy:

    Open the Document of Dragon:

    HP SimplePass upgrade instructions

    Follow the procedures described in the guide for

    1. Export your Webcards
    2. Reinstall the driver of validity
    3. Restart / reboot the computer and log in
    4. Fix HP SimplePass program
    5. Restart / reboot the computer and log in

    Click on the Thumbs - Up Kudos to show that you appreciate the help and time of our Experts.

    Click on accept as Solution when the answer is a good solution or workaround!

    Although I strive to reflect best practices of HP, I do not work for HP.

  • Update KB937287 keep apearing as the only updated, try install many times, but does not work, tried it with the standalone version and it keeps apearing

    Update KB937287 keep apearing that the only update, tried to install a lot of times, but does not work, tried it with the standalone version and it keeps apearing, when I install it does not display an error message, just say that again was successful but when I try to look for more updated it apears again.

    Hi mayortom,

    Thank you for visiting the Microsoft answers Forum.

    You can follow the steps outlined in the article below:

    Troubleshooting Windows Update or Microsoft Update when you are repeatedly offered an update
    http://support.Microsoft.com/kb/910339/

    I hope that helps!

    Thank you and best regards,
    Abdelouahab Microsoft responds to the technical support engineer

  • Here's a strange. I have a HTML page with this time a wmv video. It works perfectly from a USB stick or SD card, but does not work when they are copied to the hard drive

    I have an HTML page created with web expression 4. It contains only a wmv video. It works perfectly when it is called from a USB stick or SD card, but does not work when they are copied to the hard drive. The results are the same with IE and Firefox. It don't make no difference if I use Media Player V9 or V11. He has no control on the page Media Player. Video and html files are in the same directory. Here is the code snippet:

    LIFT, DRAG, THRUST and GRAVITY










    If I run it on a machine with Win 7 there is no problem.

    Richard Grosser

    Hi Richard c. Grosser,.

    Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the Microsoft Expression forums.

    http://social.expression.Microsoft.com/forums/en-us/categories

  • Tax Turbo installed but does not work on Windows Vista

    Tax Turbo installed but does not work. He says"this file does not have a program associated with it for performing this action. I don't know what the problem is. Exchanged the software still does not work.

    Sometimes, says "Application not found" program seemed to install and icon is on the screen, just at the moment where I got to run the program, it does not work and says it's "shutting down".  Any help?

    Have you ever successfully run this program on your machine?  So the system restore helps you, if if he was running very recently.

    How to repair the operating system and how to restore the configuration of the operating system to an earlier point in time in Windows Vista
    http://support.Microsoft.com/kb/936212/#appliesTo

    Which edition we talk to TurbTax, anything earlier than 2006 may not be not fully compatible with Vista?  64-bit versions may not be compatible at all?

    Have you tried right clicking on the shortcut to the program or the .exe and select "Run As Administrator"?

    The program will run in Mode safe?

    Vista advanced boot options
    http://Techblissonline.com/Vista-advanced-boot-options/

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/default.aspx/KB/929135

    Problems with the launch of other programs via shortcuts on your desktop?

    Try running ChkDsk to check your drive for errors. Right click on your drive icon / properties / tools / error checking.  Try first by checking do not each box (that it will run in read-only mode) to see if it reports any problems file or hard drive.  If so, restart it by checking both boxes and restart to allow him to attempt to fix any problems found.

  • Adobe Flash is installed but does not work.

    Shows that Adobe Flash is installed but does not work.  whenever I try to watch a video, it says I need to install adobe flash

    original title: adobe flash

    Why do you send the original to a download of the Adobe Reader software, poster when their question Abobe Flash Player?

    The current version of Adobe Flash Player is 11.2.202.235

    http://get.Adobe.com/flashplayer/

  • Cannot install itunes. It installs but when I clicked on it said has not been installed correctly. I uninstalled, reinstalled several times but does not work.

    Cannot install itunes. It installs but when I clicked on it said has not been installed correctly. I uninstalled, reinstalled several times but does not work.

    Trying to download iTunes again, but instead run the installer from its current location, try saving it to your hard drive and then run the configuration file.

    Problem installing iTunes or QuickTime for Windows
    http://support.Apple.com/kb/ht1926

    iTunes for Windows Vista or Windows 7: troubleshooting...
    http://support.Apple.com/kb/ts1717

    You can try both uninstalling and reinstalling as a new user to see if that helps:
    http://Windows.Microsoft.com/en-us/Windows7/create-a-user-account

    If this isn't the case, I recommend you contact Apple for assistance.

    Check your hard drive for errors:

    Click Start

    Type: CMD, according to the results, right-click CMD

    Click on "Run as Administrator"

    At the command prompt, type: chkdsk /f /r

    When you restart your system, your computer will be scanned for errors and will try to correct them.

  • I created a Javascript script that adds a watermark on the document action "paper print".  This works in Acrobat Pro, but does not work in the drive.

    I created a Javascript script that adds a watermark on the document action "paper print".  This works in Acrobat Pro, but does not work in the drive.  I am a novice using Javascript, so what am I doing wrong?

    Cannot use either addWatermarkFromFile or addWatermarkFromText methods of document with player as shown in the documentation. You can hide/display the form fields and the existing layers, so consider this approach.

  • I installed the German version of Photoshop, now I need the version in English for some actions, that I bought. In Photoshop preferences is German and I can't change to English. I changed my Creativ cloud in English, but does not work for Photoshop. I do

    I installed the German version of Photoshop, now I need the version in English for some actions, that I bought. In Photoshop preferences is German and I can't change to English. I changed my Creativ cloud in English, but does not work for Photoshop. What do I need to reinstall Photoshop in English?

    Also if you wish, you can take back to the top of Presets, plugins... before uninstalling.

Maybe you are looking for