Display Years between dates - Need Help.!!!

Dear Reader,
I need help to resolve this.
Below are the values stored in table:
SOME_ID      START_DATE     END_DATE
1                     15-NOV-2001        04-MAY-2002
1                     05-MAY-2004        04-MAY-2007
1                     05-MAY-2007        27-JAN-2008
2                     07-NOV-1991        02-FEB-1994
2                     07-NOV-1998        02-FEB-1999
For example, the query should return as follows :
For SOME_ID 1:
SOME_ID        YEARS
1                      2001
1                      2002
1                      2004
1                      2005
1                      2006
1                      2007
1                      2008
Kindly help in providing the solution.
Thanks in Advance.

with sample_table as (
                      select 1 some_id,to_date('15-NOV-2001','dd-mon-yyyy') start_date,to_date('04-MAY-2002','dd-mon-yyyy') end_date from dual union all
                      select  1,to_date('05-MAY-2004','dd-mon-yyyy'),to_date('04-MAY-2007','dd-mon-yyyy') from dual union all
                      select 1,to_date('05-MAY-2007','dd-mon-yyyy'),to_date('27-JAN-2008','dd-mon-yyyy') from dual union all
                      select 2,to_date('07-NOV-1991','dd-mon-yyyy'),to_date('02-FEB-1994','dd-mon-yyyy') from dual union all
                      select 2,to_date('07-NOV-1998','dd-mon-yyyy'),to_date('02-FEB-1999','dd-mon-yyyy') from dual
select  distinct some_id,
                 column_value years
  from  sample_table,
        table(
              cast(
                   multiset(
                            select  to_number(to_char(start_date,'yyyy')) + level - 1
                              from  dual
                              connect by to_number(to_char(start_date,'yyyy')) + level - 1 <= to_number(to_char(end_date,'yyyy'))
                   as sys.OdciNumberList
  where some_id = 1
  order by years
   SOME_ID      YEARS
         1       2001
         1       2002
         1       2004
         1       2005
         1       2006
         1       2007
         1       2008
7 rows selected.
SQL> SY.

Similar Messages

  • Sign in told my firefox is out of date, need help to sign in my email funstarling at hushmail

    I sign in told my firefox is out of date. I did try the upgrade but could not do
    need help to get my sign in working
    my sign in is funstarling, and xxxxxxxxx

    Hi funstarling,
    Please remember this is public and showing passwords in a post can alow others to use the credentials.
    It is possible to manage passwords from the Options or Preferences menu under advanced tab. If you click show password it will show the password if in the past it was chosen to be remembered.
    Please also try the account recovery for a new password.
    Also what version of Firefox is saying it is out of date?
    Looking forward to your reply!

  • I haven't used an Apple computer for years. I need help getting started

    I just bought a mac mini after 20 years using a PC.  I need help getting started.  Any beginning manuals out there?  Thanks.

    New User of Apple wrote:
    I just bought a mac mini after 20 years using a PC.  I need help getting started.  Any beginning manuals out there?  Thanks.
    Welcome back. Do not overlook the Finder and individual application Help menu support. The links provided above are great starter references. With tongue in cheek, they also may not be as current as the OS X release on your mini, so expect some differences.
    Here are a litany of keyboard short-cuts, last updated in June 2012, that may prove selectively beneficial.
    For actions like copy(c), paste(v), cut(x), print(p), and select-all(a), substitute the command key instead of control key.
    If you right click on a file, this menu will seem familiar. Press the option key and notice the menu changes. If you copy a file(s) from this menu, change to the destination and then press option with the right button menu to see copy file(s) changed to move file(s).
    To quickly view a file's contents, left click on the file icon, then press the space bar.
    The native file format for OS X is PDF. Thus, when you choose to print, you also have the option to save as PDF with web links preserved.
    Enjoy your mini.

  • Need a way to display/toggle between data like tabbed Spry

    I want the functionality of the tabbed Spry but I don't want
    the tabs. I want some links and be able to toggle from link to link
    displaying info in an area of the page without navigating to
    another page.
    Is there a way to do this in Dreamweaver?

    JerAuf,
    The Spry Tabs are simply <div> page elements styled and
    positioned with
    CSS. You can change the styling and positioning any way you
    like.
    Hope this helps,
    Randy
    > I want the functionality of the tabbed Spry but I don't
    want the tabs. I want
    > some links and be able to toggle from link to link
    displaying info in an area
    > of the page without navigating to another page.
    >
    > Is there a way to do this in Dreamweaver?

  • Data display on Bar graphs - Needs help

    Hi,
    I am facing a problem with discoverer's bar graphs.
    There is a 2D Bar Graph, which is required to display the respective strength for all the classes on the axis(e.g regionwise sales for North, West, East, South). In Oracle discoverer the sales is shown only when the mouse is pointed over the respective bar but that too at the bottom. The fixed values of the sales is not being displayed above each bar permanently.
    But the client requirement is to display the strength for each class above each bar numerically so that a print out can be taken along with values.
    Please suggest how can this be done.
    Goga

    On the Plot Area tab, check the "Show Data Labels for bars". To the right of that, clicking the "Options" button will let you place the labels above or in the bars.
    Also, check that the graph background color is not the same as the font color.

  • BETWEEN DATE Query help

    Dear Experts, I am new to PL/SQL and need your expert advice and help on below query,
    SELECT * FROM SCHEMA.TABLE
    WHERE DATETIME BETWEEN (TO_DATE('SYSDATE-1 07:00:01','MM/DD/YYYY, HH24:MI:SS')) AND (TO_DATE('SYSDATE-1 14:59:59','MM/DD/YYYY, HH24:MI:SS'));
    I want to automate above query which will select yesterday data from mentioned starttime (07:00:01) to endtime (14:59:59).
    Please help.
    BR,

    Hi,
    DBA wrote:
    I am using below duration in between to get a complete day duration data (of yesterday),
    DTIME BETWEEN TRUNC(SYSDATE-1) + 0/24 + 1/12/60/60 AND TRUNC(SYSDATE-1) + 23/24 + 1799/12/60/60
    Is it valid for a complete one day duration (of yesterday)?
    Please help in clarifying this confusion.
    Bundle of thanks!If you have to ask, then that means it will be hard to debug and maintain.
    Here's a simpler way to find rows where dttime is after 7:00 AM yesterday, but before 3:00 PM yesterday:
    WHERE     dtime     >  TRUNC (SYSDATE - 1) + ( 7 / 24)
    AND     dtime     <  TRUNC (SYSDATE - 1) + (15 / 24)This will pick rows where dtime is as little as 1 second after 7:00 AM, but not 7:00 AM itself. If you want to include 7:00:00 exactly, change the > to >=.

  • I am 67 years old and need help this a disgusting company that they can't help the elderly with phone support

    this a disgusting company that they can't give phone support to a 67 year old woman that doesn't understand all this giberish computer

    This is a user to user forum, not Adobe support... ask a question and someone may be able to help
    The information you need to provide when you ask a question is below... sorry... video editing IS fairly technical
    From the Premiere Elements Information FAQ http://forums.adobe.com/thread/1042180
    NOTE - McAfee kills the program http://forums.adobe.com/thread/1460089?tstart=0
    •You MUST use an account with Administrator Privileges to run Premiere Elements
    •(Doing Run as Administrator http://forums.adobe.com/thread/969395 [says Encore and also for "All" versions of Premiere] will sometimes fix "odd" errors)
    •What version of Premiere Elements? Include the minor version number (e.g., Premiere Elements 12 with the 12.0.1 update).
    •What operating system? This should include specific minor version numbers, like "Mac OSX v10.6.8"---not just "Mac"
    •Has this ever worked before?  If so, do you recall any changes you made to Premiere Elements, such as adding Plug-ins, brushes, etc.?  Did you make any changes to your system, such as updating hardware, printers or drivers; or installing/uninstalling any programs?
    •Have you installed any recent program or OS updates? (If not, you should. They fix a lot of problems.)
    •What kind(s) of image file(s)? When talking about camera raw files, include the model of camera.
    •If you are getting error message(s), what is the full text of the error message(s)?
    •What were you doing when the problem occurred?
    •What other software are you running?
    •Tell us about your computer hardware. How much RAM is installed?  How much free space is on your system (C:) drive?
    And some other questions...
    •What are you editing, and does your video have a red line over it BEFORE you do any work?
    •Which version of Quicktime do you have installed?

  • Building a report from SCOM DATA- NEED HELP!!!!!!!!!!!

    Hello
    Can someone help me with trying to obtain data on a specific rule? I need data on availability of a system and time down included. I use a bit of sql and powershell but I am having trouble finding counters and the actual
    compilation of the report. I use Report Builder , SSMS  and Operations Manager
    Sinxcerely
    Elise 

    Hi,
    Please review the report below.
    Reporting > Microsoft Generic Report Library > Availability
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • I'm trying to connect my 23" Cinema display to my iMac, need help with connector cable.

    I'm trying to connect my 23" Cinema Display monitor to my iMac. The adaptor cable I ordered came with a female, I need a male adaptor. Any ideas where I might find one? I purchased the BlueRigger Mini Displayport Male to DVI Female Adapter Cable.

    I have the 23" aluminum Cinema Display. I just can't seem to find the right adaptor for the monitor femal plug on the backside. I've tried a Bluerigger but it was a female adaptor. I believe I need a male.

  • Mini display to VGA weirdness - need help connecting to CRT

    Hello,
    I am new here and recently purchased a Mac Mini (2011, 2.3 Mhz i5 model).
    I am probably in the vast minority as far as monitor choices go, as I am using a NEC FE2111SB CRT monitor. 20" viewable, looks good or better than most LCDs, so I see no need to replace it. I have the mac hooked up via a mini display to VGA adapter and it works, but has some weird problems.
    When booting to Windows 7 through bootcamp, the screen starts off all white (like normal), but then goes black. Nothing. I wait a while, then my normal Windows login screen eventually pops up. So for whatever reason, the entire Windows boot screen (one with win 7 logo, etc) won't show up at all.
    The boot screen does show up if hooked to a LCD. But I tested two CRTs, and the boot screen is black for both, no signal.
    I was guessing that perhaps the boot screen used a weird resolution or refresh rate through Apple's EFI, so I figured I'd try several things. First was simply changing the resolution on the mac side of things. And then I noticed other weirdness. If Lion is set to high resolutions, say 1200x960, or 1600x1200 (or anything besides 1024x768), then I also lose the white (apple) screen that typically pops up when starting the machine. The white screen being what you see when it first starts, then you can press the keyboard to get the apple OS choices (if bootcamp is installed).
    So basically what I have is: if I leave lion at 1024x768, I get the white apple boot screen, and it boots into lion normally.
    If lion is anything besides 1024x768, I lose the white boot screen, and am loading lion blindly, just waiting for the lion login to hopefully pop up eventually.
    If lion is set at 1024x768, then I do get the mac boot screen, yet bootcamp/windows is all black until windows 7 boots up. I have not found any resolution or refresh rate at all that will allow me to see the windows 7 boot screen when using bootcamp, and this adapter + CRT.
    Any suggestions? I have tried two minidisplay to vga adapters, apple's and rocketfish, both had the same problems. Although I found the apple branded one to be a little more finicky than the rocketfish adapter.

    Possibly too many adapters.
    Signal strength dropped off when I used minidisplay-to-DVI/DVI-to-VGA/VGA-keyboard-viedo-mouse splitter, and "nothing" came through.  minidisplay-to-DVI/DVI cable worked fine.

  • Spry menu displays as bullets [was; NEED HELP PLEASE]

    Thank you for taking the time to help me with this:
    when ever I create the spry menu bar in Dreamweaver it sets it as bullets, it isnt noticeable in dreamweaver or when I test it in safari,firefox, etc.. but as soon as I upload it to the ftp host it distorts the site because it shows the menu bar in bullets???
    *The picture attached is screen shot of just the menu bar(it should be only 1 line)
    -Colbie McRae
    [Subject line edited by moderator to make clear what post is about]

    Make sure you have linked and uploaded the Spry Assets that come with the Menubar. As you can see, the Menubar is a simple list that takes its functionality from its associated JavaScript and CSS files.
    The CSS and Javascript files need to travel with the page with the Widget on it.
    Z

  • Right format on a date, need help

    I get a dateparameter from my jsp. This is in format "dd.MM.yyyy". When I parse it to a date the result is e.g:
    Sun Feb 10 00:00:00 GMT+01:00 2002.
    How can I get this to be in the preferred format (dd.MM.yyyy)?
    My code is:
    SimpleDateFormat formatter = new SimpleDateFormat ("dd.MM.yyyy");
    ParsePosition pos = new ParsePosition(0);
    Date fromdate = formatter.parse(request.getParameter("fromdate"),pos);

    I don't check it in a special way.
    This is all the needed code (in a JSP page):
    SimpleDateFormat formatter = new SimpleDateFormat ("dd.MM.yyyy");
    DecimalFormat df = new DecimalFormat("###,##0.00");
    DecimalFormat dfNoDigits = new DecimalFormat("###,##0.##");
    // get parameters
    String customerId = request.getParameter("customerId");
    Date fromdate = formatter.parse(request.getParameter("fromdate"));
    Date todate = formatter.parse(request.getParameter("todate"));
    <td>
    <%=from%> <input type=text name="fromdate" value="<%=fromdate%>" style='font-family: Verdana; font-size: 10px' size=12>  
    <%=to%> <input type=text name="todate" value="<%=todate%>" style='font-family: Verdana; font-size: 10px' size=12>  
    <input type="hidden" name="customerId" value="<%= customerId%>">
    <input type="submit" style="font-family: Verdana; font-size: 10px" value="Vis">     
    </td>
    As you can see I create a new Date object and gives it the parsed value from request.getParameter(). This is funny enough always in the long format. This value is inserted in textboxes in the JSP.

  • Startup Error - Worried About Recovering Data - Need Help!

    Hi All...
    This is my first time posting to the forum, and I'm hoping someone can help me.
    Last night, I used my MacBook Pro (specifics are pasted below) with no issues at the airport. I then boarded my flight, stowed my laptop under my seat, and landed. Total duration was about 2 hours. I got to my car, and wanted to make some notes and, when I turned on my computer, I got these screens. One is a pink and white pixelated screen, and the other is some sort of candy-striped screen with the same pink and white colors.
    I've NEVER seen anything like this before, and it's got me worried. I'm most concerned with recovering all of my files at the moment.
    The computer seems to be working normally in terms of no strange sounds, or clicks, or anything like that indicating that anything has been dislodged internally, or anything like that.
    I have all the startup and installation discs if they'll help restore anything.
    Can anyone help me? Please?
    Thank you for any advice you can offer.
    -matt

    Quick update: went to the Apple store last night and, magically, the computer turned on like nothing was wrong. I'm guessing the ghost of Steve Jobs was in that store last night.
    I'm not convinced - based on my gut, and the Apple experts - that the problem is solved. I can get the computer to boot up to diagnostics and all that, but I think it might be time for a new one. I've actually attached some screengrabs of the error report if you'd be so kind to take a look.
    That said, my funding is kind of limited at this point. And, while I'd love to throw down $1,500 for a newer model, I just can't. I'm in the $500-700 range, honestly. So, I'm wondering what you'd recommend. I purchased my current model on eBay several years ago and, as I said, it worked beautifully up until now.
    Does the year of the machine necessarily dictate how well it will function? Like, because of the two year difference - rather than the OS, or installed features - is a 2008 MAC definitely going to function less well than a 2010 MAC? I've never been sure of how that works.
    So, if you'd be interested in entertaining one last request, I guess it would be your recommendation as to what type of system I should search for. Is there a wave of MACs from the past that, in your expert opinion, seemed to perform particularly well?
    Again, I'm very grateful for all of your help. Thank you!
    Screengrabs:

  • How to find no. of days,subtract date -- need help 04/21/2008 - 11/05/2007

    ADAT is internally YYYYMMDD format in table.
    Should i move this field before computation ? IF SO WHAT IS THE FORMAT ,statement pls;
    G_days = ITAB10-ADAT - ITAB11-ADAT.
    04/21/2008 - 11/05/2007 ouput is 54.   ---THIS OUTPUT IS WRONG.
    Any better way of doing this.
    second value 11/05/2007 - 09/10/2007 ouput is 86
    SORT ITAB9 BY ADAT DESCENDING.
    APPEND LINES OF ITAB9 FROM 1 TO 7 TO ITAB10.
    DELETE ITAB9 INDEX 1.
    APPEND LINES OF ITAB9 FROM 1 TO 7 TO ITAB11.
    For eg. : if  02/30/2008 - 02/10/2008 -
    ouput should be 20 days..
    Edited by: Sona on Feb 21, 2008 1:36 AM
    Edited by: Sona on Feb 21, 2008 5:45 AM

    Hi,
    Check the following code:
    REPORT ZDATEDIFF.
    DATA: EDAYS   LIKE VTBBEWE-ATAGE,
          EMONTHS LIKE VTBBEWE-ATAGE,
          EYEARS  LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
                TODATE   LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
    call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      exporting
        i_date_from          = FROMDATE
        i_date_to            = TODATE
      I_FLG_SEPARATE       = ' '
      IMPORTING
        E_DAYS               = EDAYS
        E_MONTHS             = EMONTHS
        E_YEARS              = EYEARS.
    WRITE:/ 'Difference in Days   ', EDAYS.
    WRITE:/ 'Difference in Months ', EMONTHS.
    WRITE:/ 'Difference in Years  ', EYEARS.
    INITIALIZATION.
    FROMDATE = SY-DATUM - 60.
    Regards,
    Bhaskar

  • I cannot open any Word document or even Powerpoints or anything related to Office 2008, which has been working fine for the last 2 years. I need help...

    I installed an application called "You SendIt" because some audio files were sent to me and I had to access them through it. My Mac is running Windows and OS-X. I bought an version of Office 2008 separately. I tried to uninstall it, to get rid of all my downloads and also to reinstall Office 2008 but nothing works...
    Whenever I try to open a Word file, for example, it says:
    "The application Microsoft Word quit unexpectedly. Mac OS-X and other applications are not affected. Click relaunch to launch the application again. CLick Report to see more details or send a report to Apple"
    Of course I have tried to reset and relaunch... But it does not work. I realized today I have the same problem with Powerpoint.
    I have looked at Mac help forums... but no results...
    So, if you or your friend had any idea on how to solve this, it would help me A LOT!!
    Thank you in advance.
    Stephanie

    Hi Chris,
    Well, I tried to delete the Caches and I threw all the .plist files related to microsoft in the trash -- athough I don't know if this is the way to delete files but I haven't found another yet....
    From your other suggestions, it seems to me that you have the impression that I want to stop using Microsoft Office (it was 2007, I made a mistake) though... but this is not the case.
    So... tell me if I misunderstood correctly or if I did anything wrong, or if you have anything else to suggest...
    Thanks a lot anyways!
    Stephanie

Maybe you are looking for

  • External Firewire 800 500GB WD drive does not mount

    Hi- Here is the problem. i) Bought a lacie 500GB d2 drive using firewire 800 to connect to the iMAC but did not work. The port was seeing the drive but disconnecting it every 10 secs thinking that I was unmounting it during operations. I returned bac

  • How Can I Get an 23" Cinema Display to work with a MacBook Pro 15"?

    A 23" Cinema Display (M8536) will not display with and adapter connected to a MacBook Pro 15" (mid 2010). Adapter used is Apple Mini DisplayPort to Dual-Link DVI Adapter. What's wrong?

  • VBIOS request - MSI N760 TF 2GD5/OC

    Hi I'd like to request a UEFI GOP VBIOS for my GTX 760 Twinfrozr. I notice a similar card below but it has a different BIOS version than mine so here's my info: S/N: 602-V284-46SB1306013348 BIOS Version: 80.04.BF.00.0D (P2004-0010) Link to current BI

  • Macbook pro runs hot

    My early 2008 MacBook Pro runs very hot and can't tell if the fan is running. Any suggestions?

  • Srm badi bbp_catalog_transfer

    i have implemented badi bbp_catalog_tranfer as my requirement is to transfer the description maitained in mdm to srm. in debuggingi have found that the description are getting updated but insrm it is still getting overwritten by other description.ple