Help in the sysntax of PLSQL IF Then Elsif

Hi,
Please help me with the syntax of the following:
SELECT
parts,
weeks,
SUM(qty) qty
FROM (
SELECT
(if (is_tbd = 'yes' AND is_tbd_order = 'no') OR ex_fac_date > v_asofdate + 131 Then 'tbd';
elsif ex_fac_date BETWEEN v_asofdate - 1 AND v_asofdate + 5 AND is_tbd = 'no' THEN 'wk1';
elsif ex_fac_date BETWEEN v_asofdate + 6 AND v_asofdate + 12 AND is_tbd = 'no' THEN 'wk2';
elsif ex_fac_date BETWEEN v_asofdate + 13 AND v_asofdate + 19 AND is_tbd = 'no' THEN 'wk3';
elsif ex_fac_date BETWEEN v_asofdate + 20 AND v_asofdate + 26 AND is_tbd = 'no' THEN 'wk4';
elsif ex_fac_date BETWEEN v_asofdate + 27 AND v_asofdate + 33 AND is_tbd = 'no' THEN 'wk5';
elsif ex_fac_date BETWEEN v_asofdate + 34 AND v_asofdate + 40 AND is_tbd = 'no' THEN 'wk6';
elsif ex_fac_date BETWEEN v_asofdate + 41 AND v_asofdate + 47 AND is_tbd = 'no' THEN 'wk7';
elsif ex_fac_date BETWEEN v_asofdate + 48 AND v_asofdate + 54 AND is_tbd = 'no' THEN 'wk8';
elsif ex_fac_date BETWEEN v_asofdate + 55 AND v_asofdate + 61 AND is_tbd = 'no' THEN 'wk9';
elsif ex_fac_date BETWEEN v_asofdate + 62 AND v_asofdate + 68 AND is_tbd = 'no' THEN 'wk10';
elsif ex_fac_date BETWEEN v_asofdate + 69 AND v_asofdate + 75 AND is_tbd = 'no' THEN 'wk11';
elsif ex_fac_date BETWEEN v_asofdate + 76 AND v_asofdate + 82 AND is_tbd = 'no' THEN 'wk12';
elsif ex_fac_date BETWEEN v_asofdate + 83 AND v_asofdate + 89 AND is_tbd = 'no' THEN 'wk13';
elsif ex_fac_date BETWEEN v_asofdate + 90 AND v_asofdate + 96 AND is_tbd = 'no' THEN 'wk14';
elsif ex_fac_date BETWEEN v_asofdate + 97 AND v_asofdate + 103 AND is_tbd = 'no' THEN 'wk15';
elsif ex_fac_date BETWEEN v_asofdate + 104 AND v_asofdate + 110 AND is_tbd = 'no' THEN 'wk16';
elsif ex_fac_date BETWEEN v_asofdate + 111 AND v_asofdate + 117 AND is_tbd = 'no' THEN 'wk17';
elsif ex_fac_date BETWEEN v_asofdate + 118 AND v_asofdate + 124 AND is_tbd = 'no' THEN 'wk18';
elsif ex_fac_date BETWEEN v_asofdate + 125 AND v_asofdate + 131 AND is_tbd = 'no' THEN 'wk19';
elsif (ex_fac_date < v_asofdate - 1) AND is_tbd = 'no' THEN 'past_due';
end if;)
Thanks in advance.
Edited by: user12994685 on Mar 18, 2011 5:05 PM
Edited by: user12994685 on Mar 21, 2011 9:21 AM

Hi,
After looking at your code definitely I am going to forget things... :(
Pls refer to Oracle documentation
http://psoug.org/reference/control_struct.html -- demo for control structures
- Pavan Kumar N
Edited by: Pavan Kumar on Mar 18, 2011 2:14 PM

Similar Messages

  • When I turn on my iMac it comes up with the icon which I then log into. The password works and I then get the apple icon and the spinning wheel. After a minute it turns into a prohibited icon. If I log on the guest icon I get to Safari. Help!

    When I turn on my iMac it comes up with the login icons which I then choose and log into. The password works and I then get the apple icon and the spinning wheel. After about a minute the Apple icon turns into a prohibited icon. However, if I log in under the guest icon, I can access the wifi and get to Safari. I really don't know what to do next. Any help would be gratefully appreciated.

    Are you running any A-V? If it's an iMac 21.5, I don't think you're running Leopard, 10.5. Probably at least Snow Leopard, 10.6. This is the Leopard forum.
    This article says meant for 10.3.9 and eariler, but contains some still useful suggestions.
    http://support.apple.com/kb/TS1411
    Try a Safe Boot. Shift at the startup chime and expect a much longer time to boot. This will bring you to a login screen with "Safe Boot" in red.
    Look at this as well.
    http://support.apple.com/kb/TS1417

  • My ipod touch 4g is not being recognised on my new toshiba laptop. The ipod touch starts charging then stops. This keeps continuing. Please help.

    my ipod touch 4g is not being recognised on my new toshiba laptop or itunes. Its not being shown on my computer and its not shown as 'unspecified' in the 'devices window'. The ipod touch starts charging then stops this keeps continuing like a ongoing circle. Please help.
    I have tried on my family members laptop and its seems to be picking up. So the ipod or the usb wire is not the issue.
    I have tried everything from reinstalling itunes and updating windows.
    I have tried the diagnostics test and its still says the ipod cannot be found.

    See
    iOS: Device not recognized in iTunes for Windows
    - I would start with
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    or              
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    However, after your remove the Apple software components also remove the iCloud Control Panel via Windows Programs and Features app in the Window Control Panel. Then reinstall all the Apple software components
    - Then do the other actions of:
    iOS: Device not recognized in iTunes for Windows
    paying special attention to item #5
    - New cable and different USB port
    - Run this and see if the results help with determine the cause
    iTunes for Windows: Device Sync Tests
    Also see:
    iPod not recognised by windows iTunes
    Troubleshooting issues with iTunes for Windows updates
    - Try on another computer to help determine if computer or iPod problem

  • I tried restoring my iMac 27" slim. I followed the steps erased my data then to reinstall osx mavericks. Now that I'm trying to reinstall osx mavericks for whatever reason it doesn't completes. Can you help me out?

    I tried restoring my iMac 27" slim. I followed the steps erased my data then to reinstall osx mavericks. Now that I'm trying to reinstall osx mavericks for whatever reason it doesn't completes. Can you help me out?

    That's not quite the proper way as far as I can tell. Usually, one boots directly into the Recovery HD using COMMAND and R keys at startup. If you cannot do that then most likely there is a problem with the hard drive. Since this is a new computer i would make a Genius Appointment and take it in for service.

  • Help! When I try to purchase a song from iTunes and have agreed to the terms and conditions, it then tells me that my session has timed out... but I've only been trying for a few minutes. I can't buy songs if it keeps doing this!

    Help! When I try to purchase a song from iTunes and have agreed to the terms and conditions, it then tells me that my session has timed out... but I've only been trying for a few minutes. I can't buy songs if it keeps doing this! Does anyone know why it's doing this and how to fix it? Thanks!

    Hi mterry1723, one solution that might be worth trying is this:
    - Close iTunes, if it's open
    - Open Safari and got to 'Preferences'
    - Select 'Security' on the top
    - Untick all the security options in the menu
    - Click the 'Show Cookies' button and look for all the 'apple' entries in the left-hand column.
    - Highlight them (select them collectively) and press 'Remove'
    - Now open iTunes and buy the song as usual.
    - You may be asked to do the same security process as before, so do as asked.
    - Hopefully, the security check will now have accepted your answers and start downloading the song as normal.
    Remember to re-tick all the required security options you had just un-ticked in Safari preferences. You don't need to bother about opening the cookies again.
    I hope this has worked for you and my profoundest apologies if it has not. Worth a go, though!
    I did see this thread: https://discussions.apple.com/message/18259935#18259935 which may be of more help, mainly the last entry by 'c2boyd'
    Message was edited by: Bongomal

  • HT3275 My Time Capsule keeps saying "backup failed" due to the network password not being correct. I have not changed my password and every day I have to type the same one in and then it works. But then the same thing happens the next day. Can anyone help

    My Time Capsule keeps saying "backup failed" due to the network password not being correct. I have not changed my password and every day I have to type the same one in and then it works. But then the same thing happens the next day. Can anyone help? This only started doing this about 2 weeks ago.

    Hello,
    Mac OS X 10.4 Help, I forgot a password in my Keychain
    http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh1960.html
    Resetting your keychain in Mac OS X...
    If Keychain First Aid finds an issue that it cannot repair, or if you do not know your keychain password, you may need to reset your keychain.
    http://support.apple.com/kb/TS1544
    Open Keychain Access in Utilities, use Keychain First Aid under the Menu item, then either check the Password under that item, change it, or delete it and start over.

  • Every time i sync in my music in my iphone 5 it would have to back up my iphone and every time i back up the loading bar would freeze then my itunes with crash pls help my iphone 5 coat a lot from my savings

    every time i sync in my music in my iphone 5 it would have to back up my iphone and every time i back up the loading bar would freeze then my itunes with crash pls help my iphone 5 cost a lot from my savings

    Syncing requires a backup as part of the sync process.
    Delete any existing backups in iTunes under Edit > Preferences > Devices (or simply move them to a different folder on the computer) then try a backup or sync.

  • Just after latest upgrade, firefox is performing badly. It will open one or two websites then I get the anti-clockwise rotating arrow, then nothing. This has never happened before. I have re-installed firefox but the same happens. Please help?

    Firefox has always worked fast. But after the last upgrade, it has slowed right down. I am running Windows 7 32 bit. Now the first website loads fast; then the next website loads slower; then links gradually slow down until I just see the reverse arrow which never loads up.
    I have re-installed Firefox w/out success.
    Please help,
    Will

    Sorry your experience wasn't a plesant one, but most of the issues they work on are hardware in nature, not software.. I'm not taking up for Apple... I'd had my share of run-ins with them as well.
    As for your iTunes issue... an EASY solution is to simply tell iTunes that the location you want your tunes stored in is your Public folder. Items in your public folder can be seen and opened by others, so your wife could easily access the files there.
    For you, go to your Music folder, find the iTunes folder, and drag it to your public folder.
    Next, go to iTuness>Preferences and click on the Advanced tab, then the General Tab, and the first window you see is the iTunes Music Folder Locataion. Click Change, then navigate to the iTunes folder in you Public folder.
    Now, next time you purchase a song from the iTunes store, or import songs from a CD, they will be stored in the iTunes folder, in your public folder.
    You wife does basically the same thing except she navigates to YOUR public folder, and the iTunes folder inside.
    She will have to manually find and import any new songs you add but at least your entire library will be available for her to listen to.
    There are other ways of getting the same thing done, but I think this is the easiest.
    Quad 2.5   Mac OS X (10.4.6)  

  • The song I downloaded is corrupted-help! It plays for 30 seconds then stops it's a 3:45 song!

    the song I downloaded is corrupted-help! It plays for 30 seconds then stops it's a 3:45 song!

    If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copy of the track and try redownloading a fresh one. See the following document for instructions:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise, I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not playing properly. If you can't see "Report a Problem" next to the item, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.

  • Everytime I boot up firefox, this help page occurs, won't close and then will reappear dozens of times at the same time

    All of s a sudden, my home pages takes forever to come up and when I try to call up another web address,The mozilla hlp page appears. If I try to close it, new tabs will appear,often dozens of them all attempting to reopen the mozilla help page.

    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414
    If you try all these Steps and you still have issues... Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
    Be sure to make an appointment first...

  • I have an urgent question about my indesign. I had problems with the creative cloude app and then uninstalled it and then installed it again. Now it is not opening and I cannot download it again either. Pls give me help and advice if there is anything I c

    I have an urgent question about my indesign. I had problems with the creative cloude app and then uninstalled it and then installed it again. Now it is not opening and I cannot download it again either. Pls give me help and advice if there is anything I can do to repair it

    Please authorize ADE 3 with same credentials that you used with older version of ADE

  • I can't open mail, all I get is a white page with the 5 icons at the top right, the flag, folder etc.  then the white pages disappears.  I have rebooted, reset my iPad, doesn't help.  HELP anyone....tnx

    I can't open mail, all I get is a white page with the 5 icons at the top right, the flag, folder etc.  then the white pages disappears.  I have rebooted, reset my iPad, still can't get mail to open.  HELP anyone....tnx

    Hello tomzmem,
    Welcome to the Apple Support Communities!
    This situation does sound very frustrating. I know that you have tried some great troubleshooting steps already and the issue remains unresolved. Have you forced the Mail application to close and then opened it back fresh? If not, this is the next troubleshooting step I would suggest. Please let me know if the issue remains unresolved. 
    Force an app to close in iOS - Apple Support
    Have a great day,
    Joe

  • My mac won't recognize an external monitor. The screen Goes Blue Once, then goes blue again and the second monitor just turns off. I am using an HDMI adapter to a visio TV. I also have my xbox on the tv. Can anyone Help??

    My mac won't recognize an external monitor. The screen Goes Blue Once, then goes blue again and the second monitor just turns off. I am using an HDMI adapter to a visio TV. I also have my xbox on the tv. Can anyone Help??

    Lol, figured out the first part. Just for those who may be searching, when you click on the Display Preferences, and click on the arraingment tab... it not only shows where your two screens will be displayed, but the WHITE BAR at the top of one screen is the dock/toolbar. Click and hold to grab this and just slide it over to the screen you'd like it to be on.
    You have to release it IN the screen box, not on top of it... and it should pop right over to the new (or old) screen. At any rate, you can put the dock on either (or any) screen that you prefer.
    I am thinking of ordering more of these. Lol. 3 monitor setup seems like it would be crazy good.
    Still looking for the answer to keeping the new 16" screen on the right without switching between screen #s with that... not expose... Lion feature.
    Thanks. Hope my other question has an answer out here.
    Paul H

  • Help i have an iphone 5s and whenever i dowload an app or update, the symbol turns to install then the circle loading, then all of a sudden it goes back to the price symbol. I am having a tough time can anyone help me.

    Help i have an iphone 5s and whenever i dowload an app or update, the symbol turns to install then the circle loading, then all of a sudden it goes back to the price symbol. I am having a tough time can anyone help me.
    ________________________________________________________________________________ _____________________________________________________ Also all my wifi apps dont connect to the internet except for safari and maybe appstore HELP??!!!!!
    Both these problems are happening at the same time so i dont know if they are linked or something but please someone help

    Hello shahnaztech
    They probably could be related. Start with the articles below to troubleshoot issues with Wi-Fi as well as making sure that the router is using the recommended settings.
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/TS1398
    iOS and OS X: Recommended settings for Wi-Fi routers and access points
    http://support.apple.com/kb/HT4199
    Regards,
    -Norm G.

  • I got an iPhone 3gs!! i tried updating it to iOS 6!! but then went off in between after it stopped and remained stucked! i pressed the power button nd the hme button 2geta! then it went off.... now when i switch it on.. it goes on then off then on.. help!

    i have an iphone 3gs........it is not jailbroken........I was updating to iOS 6!! THen a box came up saying ios 6 will install in 5 seconds................ after wards....... it shut down then restarted.............. the apple logo came up and then below it was a bar.......... it had to be full to complete the installation ............ after a few minutes the bar stopped in between and remained stuck!!! then i pressed the home button and the powerr button together........ it turned off!!! then i restarted it ......... the apple logo comes up then goes off!! it happens and is not stoping until i press the power button once!! whenever i m starting it ....... the apple logo is coming up then goes off ... plz help me........... my father will scold me!! plz :'( plzz :'( thank u.......... :'(

     

Maybe you are looking for

  • 975X Platinum PowerUp Edition

    MSI 975X Platinum PowerUp Edition(MS-7246, PCB 2.1) Beta BIOS ver, 7.54 Date: 04/26/07 Make and ensure PC is stable before proceed. flash BIOS from USB key, by using our Tool(easy & safe way to flash): MSI Forum HQ USB Flashing Tool  Use Beta or Modd

  • How burn DVD from iPhoto in MacBook Pro

    I am trying to burn photos to a DVD . I inserted blank DVD-R, selected the photos, and selected burn  from the Share drop down in iPhoto.  Nothing happens.

  • Need BADI or EXIT after Save of BP data

    Hi, I am replicating BP data from ISU to CRM. My data is coming smoothly. I need to do some enhancements in CRM side after BP data of ISU will get save into CRM. I need a BADI or EXIT in CRM which will call  after my ISU data will get Save into CRM.

  • Flash Builder 4.0.0 doesn't find updates

    Hello everybody, As the tile reads, I can't update my Flash Builder installation (4.0.0), nor the Flex SDK version (4.0). My system is Mac Os X 10.6.4. I installed Flash Builder as part of the CS5 Web Premium package I bought in September 2010, and I

  • Dell XPS 15 : Nvidia hardwired HDMI with multiple monitors with KDE

    Hello everyone, I did an Archlinux instalation a few months back in my Dell XPS 15 laptop and configured my Nvidia card with bumblebee and primusrun. I have a extra monitor now and want to use dual monitors with my system. I tryed the following guide