Last ten years and 5 years afterwards from Current year

How can i get last ten years and 5 years afterwards from Current year in a single query which is picking data from dual.

SQL> select add_months(sysdate, -1 * 10 * 12), add_months(sysdate, 5 * 12) from dual ;
ADD_MONTHS( ADD_MONTHS(
14-FEB-1996 14-FEB-2011
1 row selected.
SQL>
[rep]                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Get date between 1st of current year and 31st Dec of current year

    Hello:
    I have a query where there is a check on date that has to be between 1 jan curr year and 31 dec curr year. How can I have that since the year component will be changing from year to year?

    use the year component of sysdate?
    ME_XE?select to_char(sysdate, 'YYYY') from dual;
    TO_CHAR(SYSD
    2007
    1 row selected.
    Elapsed: 00:00:00.12
    ME_XE?select to_date('01-jan-'||to_char(sysdate, 'YYYY'), 'DD-MON-YYYY') from dual;
    TO_DATE('01-JAN-'||TO_CHAR
    01-JAN-2007 12 00:00
    1 row selected.
    Elapsed: 00:00:00.18

  • I've been taking screen shots for years and opening them from my desktiop. Suddenly, today, I've lost the ability to open them. I can right click on the picture and do "quicklook", but that's it. They just won't open.   Similary, if I scan an image and sa

    I've been taking screen shots for years and opening them from my desktiop. Suddenly, today, I've lost the ability to open them. I can right click on the picture and do "quicklook", but that's it. They just won't open.
    Similary, if I scan an image and save it as a PDF file in pictures, I'm suddenly not able to open it either!
    Why?

    Move the com.apple.screencapture.plist file out of /username/Library/Preferences/ to the Desktop, log out and back in, and try again.
    BTW, use the default 10 point setting for text. Your choice just wastes screen space.

  • Function module to derive start and end dates from fiscal year and period.

    Hi,
    I want to know a function module to derive start and end dates from fiscal year and period.
    ie: If I have say fiscal year '2010' and period '07', then the start date of this period would be '01.10.2010'.
    Thanks.
    Moderator Messge: Basic Date questions are not allowed.
    Edited by: kishan P on Oct 18, 2010 4:45 PM

    Hi,
    This is one of my exit that display the calmonth (offset -12). Usefull when I have to retrieve in a KF a complete rolling year depending one calmonth.
    S_VMUCMN is my selection variable
    S_TXTCMN_M12 is my text variable calmonth-12
    S_TXTCMN_M0 is my text variable for selected calmonth.
    WHEN 'S_TXTCMN_M12'.
        IF i_step = '2'.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'S_VMUCMN'.
            CLEAR l_s_range.
            " First day of the selected month
            CONCATENATE loc_var_range-low '01' INTO l_calday.
            CALL FUNCTION 'YFRBW_FUM_CAL_DATE_IN_INTERVAL'
              EXPORTING
                date      = l_calday
                months    = 12
                signum    = '-'
              IMPORTING
                calc_date = l_calday.
            l_s_range-low = l_calday+0(6).
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            APPEND l_s_range TO e_t_range.
            EXIT.
          ENDLOOP.
        ENDIF.
    Thus, in KF header you have to put the two text variable to display the complete period.
    Hope it helps,

  • How do I replicate my software and data my from current Mac desktop to my new Mac laptop?

    How do I replicate my software and data my from current Mac desktop to my new Mac laptop?

    Connect the two with a Firewire cable: Transferring files between two computers using FireWire. Boot the old computer into Target Disk Mode. Start the new computer normally which should take you to the Setup Assistant if this is the first time you've started it. Use the option in Setup Assistant to transfer data from the old computer.
    If this is not the first time you've started the new computer then use Migration Assistant in the Utilities folder to transfer your data.
    Migration Assistant tips and tricks
    OS X Lion- How to use Migration Assistant to transfer files from another Mac

  • How to calulate previous fiscal year from current year and periods as input

    hi all,
    i have a report where i have 2 select options as year and period.
    my period can be a range  like( Ex: 1 to 6).
    i like to know previous fiscal year from the following inputs.
    Tel me a suitable conversion routine to calculate
    depending on periods and fiscal year.
    regards
    sivaram.

    Hi
    U need to check the lower period, if it's 1 the previous fyscal year will be the year before:
    IF PERIOD = '1'.
      PREV_YEAR = YEAR - 1.
    ENDIF.
    U can also use the fm FI_PERIOD_DETERMINE, in this case you need a date, u can get it from lower current period:
    Get the first day of the period
    BUDAT(4)   = YEAR.
    BUDAT+4(2) = PERIDO_LOW.
    BUDAT+6(2) = '01'.
    Now get the last day of the previous month:
    BUDAT = BUDAT - 1.
    Use this date to get its period by fm FI_PERIOD_DETERMINE
    Max

  • Getting Start and End Date of Current Year?

    Hi Folks,
    How do I get the start of the year and end of the year in Java ?
    If I say :
    Calendar cal = Calendar.getInstance();
    int day = cal.get(Calendar.DATE);
    int month = cal.get(Calendar.MONTH);
    int year = cal.get(Calendar.YEAR);
    System.out.println("Day: " + day);
    System.out.println("Month: " + month);
    System.out.println("Year: " + year);
    I get the current day and time.What I need is the start of the current Year (Jan 2010) and the End of the Current Year (Dec 2010).
    How can get the above 2 dates if I the current date is March 24th 2010 ?
    Thanks

    sabre150 wrote:
    What am I missing? The start date of 2010 is 1/1/2010 and the end data is 31/12/2010 . So, as I see it, at any time the only information you need is the current year which you currently get from int year = cal.get(Calendar.YEAR);
    Well, with the GregorianCalendar, anyway. ;-)

  • FSG - Need to find beginning balance value from current year

    Hi,
    Could any one help me please,
    i designed FSG report and the issue is we need to find the beginning balance form the current year
    and i do not know which amount type i should use in column set.
    maybe there is any way or workaround for this issue?
    example :
    when i run the report with parameter JUN-12, the XXX (beginning balance current year) = 5000
    and when i run the report with parameter SEP-12, the XXX (beginning balance current year) is still 5000
    thanks
    Lim Johny

    This is some of the worst SQL I have seen. The data element names change from table to table, and they violate ISO-11179 rules. We seldom use OUTER JOINs in a properly designed schema, we seldom need to worry about NULLs; we use COALESCE(), not ISNULL();
    we use CURRENT_TIMESTAMP, not getdate(), etc. 
    Did you know that nesting scalar subqueries will screw any hope of optimization? The changes in the formatting of program text implies that many different, inexperienced younger programmers who wrote in many different non-SQL languages. You even posted in colors,
    like grade school! 
    My guess is that everyone wrote a query without any planning, and then threw them together in one pile. 
    It seems that this nightmare has three tables and we have no DDL or other specs:
     Stock 
     Stock_Lead_Times 
     Traces
    Want to follow Netiquette and post DDL with some specs? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • I regularly back up my iphone 4 but the last update shown in itunes is from two years ago?

    i am having problems with my iphone 4 and am wanting to restore it but the last back up date is from 2 years ago. i regularly back up my phone but that date wont change. suggestions?

    no, i back up to the same computer that i have been for the two years that ive had the phone

  • Difference in closing balance of last year and opening balance of next year

    hi all,
    when i see the cumulative balances of bank g/l in T.code-FS10N for the last year and see the balance carried forward in this year , i have found a small amount of difference of Rs.300. I have checked the line item balances and it is showing the balances of last year only. Can anybody please tell me the reason of such difference . Is it a normal feature?
    Thanks-
    SAMRAT

    Hi,
    Please check the last year balance, if that is ok.
    Please carry forward the balance once again, then check.
    FAGLGVTR for new GL
    Note: There may be possibility that after doing the balance carry forward, user may done any back dated posting.
    Thanks and Regards
    Binoj M D

  • How to see 2 years before from current year at descrption

    Hi experts,
    ı have easy question,But ı did not manage to do it.
    Anyway my question:
    ı want to see 2 years before at current year at KF 's description ..
    For ex KF Description:2010 SAles REvenue..

    Hi ,
    This can be achieved by following the below steps :
    1. Create 1 New Selection and then in the first tab just next to the Description you can find an button for selection /creating the Text variable .
    2. Create 1 new variable with description as Calender year for example , Processing by replacement path , refernce charcteristics as fiscal period .In the next tab of replacement path you can take it as repace variable with infoobject , replace with key .
    The same you need to do it for others selections for example 2010 sales 2011 sales etc .
    You can also refer the document :
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80c171b3-b56f-2d10-cba7-ac1e758e3017?QuickLink=index&overridelayout=true
    By doing the above the description thing is done but do check for the restriction for the data related to new selections you need to put the relevant restrictions for fiscal /calender year etc .
    Hope this helps.
    Regards
    Kamal Mehta

  • NVision prior year totals are overwriting with current year

    Hi All,
    I have created an nVision report with two columns, one is for Current year(timespan-YTD) expense totals and other one is for Prev Year(timespan-Prev_Year) totals and row level i have all Expenditure accounts from Account Tree.
    When I run the report, Current Year and Prev Year coulumns are displaing same totals, when I ran the SQL trace, i found that Prev Year, column sql was running two times, one is for prev year and otherone is current year and second sql was overwriting with current year totals.
    When I looked into timespans for PREV_YEAR, I saw that "End Period Type" was set to "Relative to Current Period", when I swich to"Absoluate Period" then Prev Year column was showing Prev Year results.
    But switching Period type to : Absolute is wrong,when comparing the current year with Prev year with As of Date.
    Any thoughts on above issue.
    Thanks,
    Venky

    Dear Rachana
    The long text of error AA669 is very clear about the root cause of the
    error.
    The idea behind the message: it is not allowed to close first general
    ledger before subleger. This leads to inconsistencies. It is common
    accounting principle to always close the subledgers first and only
    then close the general ledger (FI-GL).
    The solution is: re-open fiscal year in FI-GL (txn OB52) and follow the
    steps from note 619969.
    o  RAAFAR00
    o  RAPOST2000
    o  RAPERB2000
    o  RAJABS00
    If it is not possible to open the fiscal year because audit has already
    been completed: workaround (which is not quite correct from the legal
    point of view) is the report RACORR20_A from note 29694.
    Best Regards,
    Blaz

  • First day of year and next monday of the year

    Dear all;
    Given a year, how do you determine the very first day of that year and the next two mondays for that year...

    Hi,
    user13328581 wrote:
    Dear all;
    Given a year, how do you determine the very first day of that year and the next two mondays for that year...As Sayan hinted, you can use NEXT_DAY to find the next Monday after (not the same as) a given date.
    NEXT_DAY(trunc(SYSDATE), 'MON') next_mondayis the next Monday after today. (You may not need TRUNC in the example above.)
    For the Monday after January 1 of this year:
    NEXT_DAY ( TRUNC (SYSDATE, 'YEAR')
             , 'Monday'
             )If the year happens to begin on a Monday, this will return Jaunary 8, the 2nd Monday of the year; otherwise, it will be the 1st Monday of the year.
    For the 2nd Monday after New Year's Day, add 7 to the expression above.

  • How do I update to latest version of Premiere Pro and After Affects from current version 6?

    Cyrrently running version 6 of Premiere Pro and After Affects.
    How do I go about upgrading?

    Hi Lifeonmediaboy,
    You can follow the link: https://creative.adobe.com/plans and look for the upgrade for your products.
    Thanks,
    Ratandeep Arora

  • 0I_CUFYE pulling incorrect year (ie. instead of pulling current year period

    Hi ,
    Since toady I am facign stragne error..
    till yesterday the same query was showing restriction for 001.2010-012.2010
    today it is showing 001.2011-012-2011
    this variable 0I_CUFYE is dring me craz..
    can anyone help...
    regards,..
    rK

    Hi RK:
      Check if the Note below is applicable to your system.
    SAP Note 645545 - "Retro Fit of CRM-ICM BI Content 3.3 Corrections"
    Regards,
    Francisco Milán.

Maybe you are looking for

  • ORARRP doesn't print to a printer configured through TCP/IP.

    Could any one using ORARRP pls. help ? I am pasting the TAR contents I opened with Oracle Support. Oracle Support doesn't support ORARRP. They referred me back to discussion forum. Thanks, RK Resolution History 22-MAY-02 19:25:05 GMT Can you easily r

  • Find the sales order number with  delivery document

    hi: i want to quickly look for the delivery document  related the sales order ,now i find it via se16 in talble vbfa. please help me provied with means. best regards.

  • Firefox will not open a new, secure log-in page, on my bank's site

    My Bank's website opens a new, secure, log in page from a link on its home page. When I click on this link to do so, nothing happens. No window opens and Firefox does not give any messages as to why. It used to work, but has stopped in the last coupl

  • Manual or automatic batch determination in process order

    Hi, how to know for particular process order, whether we should do manual batch determination or automatci batch determination for components without viewing the material master?

  • Paste function

    Hi All, What i would like to do is add a sort of 'paste' function to my site. http://www.milesmemorials.com/product-GH54.html As you can see there is a drop down menu for 'Inscription & Verses' with a list of codes, each code refer's to a sample of t