How can i add one month to a date variable ?

Unlike the week which always 7 days, month may change from 28 to
31, so how can i add one month to a date variable ? Thanks in
advance.

Adding 365 won't always work because of leap years.
You could use the following SQL statement:
SELECT
     TO_DATE(
          TO_CHAR(TO_DATE(SYSDATE), 'DD-MON-') ||
            (TO_CHAR(TO_DATE(SYSDATE), 'YYYY') + 1)) NEXT_YEAR
FROM
     dual
NEXT_YEAR
08-JAN-03Or you could create your own function. You would use this
exactly like add_months:
CREATE OR REPLACE FUNCTION add_years
     (v_date DATE, num_years NUMBER)
RETURN DATE AS
     v_year DATE;
BEGIN
     v_year := TO_DATE(
               TO_CHAR(TO_DATE(SYSDATE), 'DD-MON-') ||
                     (TO_CHAR(TO_DATE(SYSDATE), 'YYYY')
                                         + num_years));
     RETURN v_year;
END;     
SELECT
     add_years(SYSDATE, 1) new_year
FROM
     dual
NEW_YEAR 
08-JAN-03
SELECT
     add_years(SYSDATE, -1) new_year
FROM
     dual
NEW_YEAR 
08-JAN-01

Similar Messages

  • How can i add one phone number to my macbook pro application imessage

    how can i add one phone number to my macbook pro application imessage

    Make sure that the iPad is using the same Apple ID as your iPhone. If the phone number still doesn't appear, log out of iMessage on both devices, log back in on the iPhone, wait until it activates, then log into iMessage on the iPad with the same Apple ID.

  • How can I add one seat for a single app to a team account?

    We currently have a team for our art department, which needs Photoshop, Illustrator, In Design and Acrobat.  We have other departments that just need Acrobat.  How can I add one seat, that has access to only one App so I'm not paying the full price?

    Did you ever figure this out? I need Photoshop single licenses and Adobe is making this ridiculously difficult...

  • How can i add one wave in in our Function generator example?

    how can i add one anotehr wave in our function generator example. i want to use superposition and add one more wave to our first wave in function generator and see the result.thanks

    Hi hood1,
    2 options:
    1) You can add many waveforms by combining them into one Array.
    2) Use the Waveforms tools, that give you many option for adding waveforms. one after the seconed or adding the Y array of a waveform to other Y array of second wave form, and so on...
    Hope it Helps...

  • I'm setting up Apple ids, and its not giving me the option to set up a rescue email. How can I add one?

    I'm setting up Apple IDs, and its not giving me the option to set up a rescue email. I've set up Apple ID's in the past, and its always given me the option. How can I add a rescue email?

    You can find the instructions here. I removed the screenshots but the text is copied below.
    http://support.apple.com/kb/HT5312?viewlocale=en_US&locale=en_US
    You can edit or delete your rescue email address at My Apple ID. To edit your rescue email address:
    Navigate to My Apple ID using your web browser.
    Click "Manage your account"
    When prompted, sign in using your Apple ID and password.
    Click Password & Security
    You'll be asked to answer 2 of your 3 security questions before you can make any modifications. If you are unable to remember your answers, you can choose to send an email to your rescue email to reset your security questions.
    Note: The option to send an email to reset your security questions and answers will not be available if a rescue email address is not provided. You will need to contact iTunes Store support in order to do so. 
    After you've validated your identity by correctly answering your security questions, click Edit to the right of your rescue email address.
    Once you've finished editing your rescue email address, click the Save button directly below the email field.  

  • How can I add one more path in the classpath tag in xml

    I have added the following line in the global-web-application.xml, and it works.
    <classpath
    path="/apps01/o9ias/j2ee/home/default-web-app/WEB-INF/properties"
    />
    But whenever I add one more path into it, the oc4j can't start.
    The Oracle manual Oracle9iAS Container for J2EE is beta. It doesn't tell the grammer to do that.
    Hopefully you can share some ideas and let me know how to add some more path into it.
    Thanks.
    Wei

    Hi Wei,
    I have just done a quick search of the following URLs
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.atlassian.com
    http://www.elephantwalker.com
    And -- as is nearly always the case -- found a shamefully minute amount
    of information, and what I did find was totally useless.
    Oracle have not produced any real documentation for OC4J -- they
    claim it's coming in the next release -- and, as I already said, I
    couldn't find anything on the Internet about "global-web-app.xml" or
    "classpath" element. Therefore (surprise, surprise) your only option
    (as I see it) is just experiment and try to hack the code.
    I wish someone would please tell me if there's another option, because,
    like you, I find it very frustrating to have to continually play
    "guessing games" when trying to work with OC4J. I imagine other people
    seem to enjoy this -- since I don't see anyone else complaining.
    In any case, have you tried multiple "path" attributes, for example:
    <classpath path="/your/path/" path="/your/other/path/"/>
    Got nothing to lose, have you :-)
    Good Luck,
    Avi.

  • How can i add one field in the container for the standard task-90310004?

    Hi,
    Please let me know thw steps to add one field in the container for the standard task-90310004.
    Usefull suggestions will be rewarded.
    Regards,
    Neslin.

    <b>Hi,
    Containers are used for holding Application data for Workflow purposes.
    Event container
    Task container
    Workflow container
    Role container
    Binding is the linking of data from one container to the other for making data available all across the workflow.
    But you can get values from one container to another container like this
    Container(Con)
    1. WF Con to Role, Wf con to task con, Wf con to event
    and
    2. Event con to wf con, task con to wof con
    and
    3. Method con to task con
    and
    4. Task con to method con
    So, we don't have direct possible binding from task con to task con.
    Thanks and Regards,
    Prabhakar Dharmala</b>
    Message was edited by:
            Prabhakar Dharmala
        But you can do pass values from first task con to wf con and again from wf con to another task con

  • How do you add a month to a date?

    I want to add a month to the value above and create a series of dates.
    Thank you

    Hi MtnBiker,
    I tried =B2+"1m" but that is one minute!
    To create a series, type the first two dates, select them both and Fill Down
    Regards,
    Ian.

  • Add one hour to a date variable

    Hi,
    suppose there is a variable current with 'DD-MM-YYYY HH:min:SS'
    how i can add one hour and find a new variable one_hour_later
    ?

    sql>
    select sysdate,sysdate+(1/24) added
    from dual;
    SYSDATE ADDED 
    02-02-2007 12:58:42            02-02-2007 01:58:42
    jeneesh                                                                                                                                                                                                                                                                                                                                                   

  • HT1420 I have 5 computers already authorized with my Apple ID.  How can  I add one more.  My home has 1 IMAC, 2 Macbook Pros, 1 Ipad and 2 Iphones.  Why are you now limiting me to five computers on my Apple ID when I am clearly an Apple product supporter.

    I have six products in my home.  I can only authorize five using my Apple ID.  All my products are Apple - 1 IMAC, 2 MacBook Pros, 2 Iphones and 1 IPAD.  This doesn't seem right - We are so Mac'd out in our home and yet we are now being limited to the number of products we can have using the same Apple ID.  Any advice as to how to find a workable soliution to this?
    Thanks

    Authorise Only Applies to Computers... Not Devices...
    You state you have 1 IMAC, 2 MacBook Pros, ... this = 3 Computers... you can Authorise up to 5 computers.
    See Here for full details...
    About authorization and deauthorization
    For Devices...
    See Here...
    iTunes Store: Associating a device or computer to your Apple ID

  • How can I add [# of days] to a date?

    edit::  Nevermind, I found the answer.  I'm using AS 2.0
    Answer: new Date(year, month, date+#)  where # is the # of days to add.
    Helpful link: http://blog.flexexamples.com/2007/08/24/date-math-for-lazy-people/  (AS 2.0 & 3.0)
    Original question:
    The title is horrible, couldn't think of how to word it.
    Anyway, I want to know how I can take a date, add a few days to it, then display the resulting date.
    For example, today's date is 8/20/2010.  I want to be able to add 10 days to this and then display the result in a label or other output.
    The label would then read 8/30/2010.  If I wanted to add 15 days to today's date, the label would read 9/4/2010.
    Any help is appreciated, thanks!

    Another way of adding values to a date object is to set up constants, and this will make life easier if you do Date math frequently, or are adding to a date which is unknown until runtime (i.e., not neccessarily today's date).
                private var todayDate:Date = new Date();
                //One day, in milliseconds:
                private const oneDay:Number = 1000 * 60 * 60 * 24;
                private function addDaysToTheDate():void {
                    //The number of days you wish to add:
                    var daysToAdd:Number = oneDay * 10;
                    //Add the days to today's date:
                    var answer:Date = new Date(todayDate.time + daysToAdd);
                    Alert.show(answer.toDateString());

  • How can i add 2 to a certain date?

    in my project i try to add 2 to a date entered by the user
    but it not working
    plz help
    thanks

    2 weeks, years, minutes, seconds ? Check out the add() method of GregorianCalendar.

  • HT5312 How can i add a rescure email if i did not add one to begin with?

    So i forgot my security questions, i read the option about the resccue email.. how can i add one now becuase when i made this itunes account i never set a rescue email.

    Use the ExpressLane at https://expresslane.apple.com and the iTunes and iTunes Store for help.

  • How can i add formula to waveform data type?

    I want to interpolate my acquired data in terms of voltage to temperature. For this i need to use polynomial equation, but i am not able to directly attach formula node to the waveform data type. I want to know how can i add formula node to waveform data, and then also have it real time.

    One additional thought that may be helpful. Once you get the Y component of the waveform graph you are going to attempt to wire this into a formula node. You can do one of two things with that array. Put a for loop around the formula node and index the array into and out of the for loop. This allows you to do scalar math on the data. It is also possible to index and array in a formula node. The following KnoledgeBase demonstrates how to do this: http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/9d72b6069346942386256a0d00604ed4?OpenDocument

  • How can i add another mesh on top of the previous mesh

    Hi :
    I was trying to add multiple mesh on top of the previous mesh, not replacing the previous ones.
    Can any one help me please?
    Steve

    Steve,
    It seems that Mylenium is out.
    How can i add one more same object on top of the existing one to add mesh on top of the existing one ?
    You may Ctrl+C+F/Cmd+C+F and then set Fill and Stroke to None (at the bottom of the Toolbox).

Maybe you are looking for

  • Oracle 9i R2 in Windows XP

    I installed Oracle database as well as developer suite in my system. Everything works good in windowsXP except forms.I cannot run the forms. I came to know that Oracle Jinitiator 1.1.8.16 doesn't allow me to run forms in windows XP. But Oracle Jiniti

  • My ipod 4th gen won't update to the new one with imessage and all that.

    I got my ipod touch in march 2011. So its not ios 5. But everytime i plug it in this is what happens step by step. 1. Itunes comes up like usual and asks me if i want to updated my ipod to 5.0.1. 2. The tag your pictures come up. 3.I tag the pitures

  • Basic issue with opening Lightroom 1

    I'm a CS3 user. I just purchased Lightroom 1 and uploaded it on my vista pc. I can't open it. A box titled Confirm appears and displays the following error message: The Lightroom Catalog named "Lightroom Catalog" cannot open because it is not valid.

  • Passing Parameters to Procedure based sub report thru JRC

    Hi I am using storedprocedure based main report with a subreport and i am trying to invoke these reports with JRC. I am passing parameters to main report then it is asking parameters for subreport then i placed following statement by placing subrepor

  • Issue with Data Loading between 2 Cubes

    Hi All I have a Cube A which has huge amount of data. Around 7 years of data. This cube is on BWA. In order to empty out space from this Cube we have created a new Cube B. We have now starting to load data from Cube A to Cube B based on created on. B