Calculation of future Dates

Hello

Using a single SQL, validation of leap years, is it possible to calculate the future date, based on years, months and days of entry by the user.

Thank you

user3308033 wrote:
By validating the leap years, I mean that, when the sysdate is May 31, 2011 ' and I add 1 year, 9 months & 0 days, the output should not train like date: 29/02/2013.

It won't if you use the Frank:

SQL> SELECT ADD_MONTHS(TO_DATE('05/31/2011','MM/DD/YYYY'),1*12+9) FROM DUAL;

ADD_MONTHS(TO_DATE(
-------------------
02/28/2013 00:00:00

Tags: Database

Similar Questions

  • calculation on line data

    Hello world

    I have just started using the tiara and I have no idea how I can do a few calculations, I want to have chanell with result depends on the other chanells, but not the same data line, I can use the SMC (line, no.) and I can do to make it function in a cell with my result chanell (example for the first row of data (: SMC (1, Ch("[4]/Channel1")) = (ChD (1, Ch("[4]/Channel")) + SMC (2, Ch("[4]/Channel"))) / 2), but I don't know how I can do this function automatically for the other line (for example, line 2 ChD (2, Ch("[4]/Channel1")) = (ChD (2, Ch("[4]/Channel")) + SMC (3, Ch("[4]/Channel"))) / 2) I have a line of 500,000 of data so I need know some functions that will be clalculated this function on the lines of my data. I will be grateful for your help.

    Hello!

    For performance of good calculations on your data of type long, you must use a formula in tiara. In the past, it was the FormulaCalc command. Today, the ChnCalculate is recommended. The similar oddity in the two commands, they can only do calculations on one line (it's repeat them verry fast for all lines). For you the problem this behavior results in a no aproach obvoius. You must copy your data to a second channel, remove the number of values that gives your shift and then use the two channels for the calculation. Here's the script for offset = 1:

    Call ChnCopy("[1]/Channel","[1]/ChannelCopy")
    Call DataBlDel("[1]/ChannelCopy", 1, 1)
    Call ChnCalculate("Ch(""[1]/Result"" )= Ch(""[1]/Channel"" ) + Ch(""[1]/ChannelCopy"" )/2")
    

    Matthias

  • Commissioning a user in the future date

    Hello
    Creating a new user and put in service at OID work correctly.
    Now, I would like to create a user with a start date in the future. IOM, when the USR_START_DATE value is the future he update the USR_PROVISIONING_DATE too on the same future date but not run the provisioning to OID and the USR_STATUS is ' disabled until that Start Date.

    If there is a way to update the USR_START_DATE with a different USR_PROVISIONING_DATE and to the provioning as usual and keep as Active USR_STATUS.
    Thank you
    GE

    Published by: TG on November 1st, 2010 09:48

    Create entity adapter
    Take the variable of Type Date and the map to select System Date (provided OOTB)
    Create task logic set the Variable (even as a copy card value)

    And attach this card to insert before.

    No need to write etc. of Java Code.

  • Calculator HP48SX setting Date and time do not work

    Hello

    I use a HP 48SX calculator.

    The date and time is wrong.

    When I put date and time following message comes:

    Catalogue of vacuum.

    I use to set the date and time after orders

    Blue arrow to the right

    TIME

    What's wrong?

    Please help.

    Using this calculator with 48GX it works well.

    Jochen

    Hi!, jochen2:

    Welcome to Forum!

    Example of time... 13.52-> TIME... and press the ENTER key

    You can change the shape, to see (A / h, 12/24, m/d).

    To change or set a DATE... 08.102015-> DATE... and press the ENTER key

  • Continuously perform calculations on the data

    Hey guys,.

    So I have this program that generates pulses of signals using NOR-SCOPE, and I initially did so that each time that the user presses a button that they will perform certain calculations in order to generate a value that is stored in a table. My mentor now wants me to do so that it generates continuously pulse signals (not a single signal) and adds the values in a table. The signal seems so I need to use the parameter N samples on NI SCOPE as it does in the code below, although if anyone has a way to change this, it would be nice too.

    So basically, how can I calculate continuous pulse generated automatically over time signals? The user does not have to run the program and the computer does the rest.

    Thank you!

    You must migrate to a structure of producer/consumer. In the loop of the producer acquire the data contimuously and pass it to the loop of consumption. In the loop of the consumer, analyze the data and store the data as needed.

    A variation on the theme that I recommend is that instead of using a queue to pass data, use a user-defined event. The reason for this change is that your current code (which is basically what will end up in the loop of the consumer) is so pass data to loop through an event will allow him to fit into the current structure of the user interface.

    Oh, Yes, one more thing: get rid of the Express live. It's time to remove the training wheels...

    Mike...

  • BlackBerry smartphones I synced my calendar and now I have two appts for all future dates! Help!

    I used this blackberry without the data plan, and this is the first time that I jived with my computer since the development of the data plan.  Now, I got two of all future appts.  Someone at - it thoughts or ideas on how I missed this?

    Welcome to the JodeeS forums

    I don't see why this has happened: as you do not use a data plan, the calendar was not associated with an e-mail account on the phone. When you have added a data plan, it has created a new timetable for the e-mail account and you now 2 sets of appointments. Don't worry, it can be fixed pretty easily.

    1. make a backup of the data on the phone and schedule by using Desktop Manager (just in case)

    2. go into the Desktop Manager > Backup and Restore > advanced

    3. in the right window, all of the databases on your phone is required. Select the calendar and click on "Cancel". This erases all calendar entries so that you can return to synchronize again.

    4 synchronize the calendar now... If all goes well, you should have your calendar to return.

    Note: I suppose you use Outlook for your correct calendar?

  • How to get future data 3 months

    Hi all

    I have a requirement where I need to get future 3 months of data.

    example: this month is jan

    In the report, I need to get jan, Feb, March data months.

    Please let me know how to do this, thanks in advance.

    Thank you and best regards,

    SR

    Use the report filter using your column in months as below

    month > = month (CURRENT_DATE) and month<>

  • Calculating a due date in XI from Adobe using Java script...

    I have two fields in a form. One with the current date is calculated by the following:

    var f = this.getField ("Today"); f.value = new Date();

    The second field, I try to add 7 days to the, but I can't understand it. What script do I need to add in the existing field is filling date and add the new field to fill out this information. I tried a lot of what I found on the internet but nothing seems to work...

    "In addition, please note that I use the ' Document Javascripts" Editor-in-Chief of Adobe Pro XI.

    Any help is appreciated


    It is possible. To make it work as you want, the custom in the field today calculation script should be:

    Custom calculation script

    (function () {}

    Get a reference to the DueDate field

    var f = getField ("DueDate");

    If (event.source & event.source = f) {}

    Proceed with this script if it is triggered by a change in the DueDate field

    return;

    }

    Update the value of this field to show the current date

    var d = new Date();

    Event.Value = util.printd ("mm/dd/yyyy", d);

    Add seven days to the date of the day

    d.setDate (d.getDate () + 7);

    The DueDate field update

    f.Value = util.printd ("mm/dd/yyyy", d);

    })();

    But first remove the DueDate field calculation script. If you do not the unalterable DueDate field, a user will be able to change, but it will reset when any field value changes.

  • Calculation of current date or the previous months

    Script gurus of wishes!

    I would like to ask help on calculating Date.

    Here's my current scenario:

    The user enters a date mm/dd/yyyy ("DateField")

    Power here ask the 'DateField' to calculate these items:

    Less "DateField" 12 months = ("12MonthsAgoDateField") / mm/yyyy

    'DateField' 18 months = ("18MonthsAgoDateField") / mm/yyyy

    'DateField' less than 36 months = ("36MonthsAgoDateField") / mm/yyyy

    and so on...

    I read some posts Date of calculation, but could barely find anything that fit this scenario.

    Freely, I confess that my ability to script is very minor.

    I would appreciate help in this script.

    Thank you!

    If you really want to go into the details (or not the time to do)

    Here is the simple solution to your problem.

    I wrote a small function (a few lines)

    Put this in the document level javascript

    Function level javascript document-

    function getPastDate (textFieldName, month) {}

    var util.printd = cDate ("dd/mm/yyyy", new Date (this.getField ("textFieldName") .value));

    sDate var = util.scand ("mm/dd/yyyy", cDate);

    If (sDate == null) {}

    App.Alert ("Please enter a valid date in the form \"mm/dd/yyyy\". »)

    } else {}

    update var = new Date (sDate.getFullYear (), (sDate.getMonth () + months), sDate.getDate ());

    Return util.printd("mm/yyyy",pDate);

    }

    }

    Now suppose that we have a text box name "Text1" including the date in the format "mm/dd/yyyy".

    1st parameter is for the name text box (seen the date that you want to process)

    2nd parameter is the number of months (to subtract pass a negative value)

    If you want to get the result in another area of text "Text2" write the following code in the event to calculate Text2

    Event.Value = getPastDate ("Text1",-12);

    This removes 12 month value "Text1".

    Hope this will help

  • The Date fields limited to allow only the past or future Dates?

    Hello

    I use LiveCycle ES3.  My request is simple.  I have several date throughout my form fields.  Some date fields must enable the last dates; Some date fields must enable as dates in the future.  When an invalid date is entered, the date should be dismissed, the rest of the required field and an error message pops up, saying: "this date cannot be in the future" or "this date cannot be in the past", depending on the field in which it is.

    As a note, I used the exact script of the demo file "Highlighting the required fields", but I discovered that this script is too complicated and even worse still it is incorrect.

    Any help would be greatly appreciated.

    Thank you.

    Hello

    could you please send a link to "highlight fields"?

    This code is what you ask for:

    var d = this.rawValue;

    dArr var = d.split("-");

    D1 var = new Date (dArr [0], dArr [1-1, dArr [2]]);

    var dNow = new Date();

    var diff1 = Math.floor ((dNow.getTime () - d1.getTime (()) / 86400000);

    If (diff1 > 0) {}

    xfa.host.messageBox ("past" + diff1);

    }

    diff2 var = Math.ceil ((d1.getTime () - dNow.getTime (()) / 86400000);

    If (diff2 > 0) {}

    xfa.host.messageBox ("future" + diff2);

    }

    Put it in the Validate event.

    Also define the Model of Validation... to this day {J MMMM AAAA}

    in both screen | Change | Validation tab

    That's how I tested it, but you should be able to choose what Validation model you like.

    It will be useful.

  • Calculation of the date fields

    Hello

    I have three fields. 2 are formatted with the date field, and the third for the calculation of the difference between 2 date fields.

    For example, Field1 said August 2012, and field 2 said Sep 2012. Is it possible that I can do field 3 dipslay the 1 (month) response?

    Any help would be greatly appreciated.

    Thank you

    Yes, you use the date object JavaScript extract fields of the whole of the year and the month, create a common denominator for the month and year, and do the math.

    The event of calculation for the number of months:

    Delete the result value

    Event.Value = "";

    get field values

    var sStart = this.getField("Date1").value;

    Send var = this.getField("Date2").value;

    process if we have data

    If (sStart! = "" & send!) = "") {}

    convert date objects date strings

    var start = util.scand ("mmm yyyy", sStart);

    oEnd var = util.scand ("mmm yyyy", sending);

    get the full date and month year beginning

    var nStartFullYear = oStart.getFullYear ();

    var nStartMonth = oStart.getMonth ();

    convert data from start of month

    var nStartMonths = (nStartFullYear * 12) + nStartMonth;

    Get the complete year end date and month

    var nEndFullYear = oEnd.getFullYear ();

    var nEndMonth = oEnd.getMonth ();

    convert data from end of month

    var nEndMonths = (nEndFullYear * 12) + nEndMonth;

    do the math

    Event.Value = nEndMonths - nStartMonths;

    } / / end have given

    You will need to adjust the names for the start and end dates.

  • Calculation of field date

    I have a form that the user enters a date of completion of a given field and I want to have this date + 45 days calculated in another area (expiration date). Any ideas on writing scripts for it?

    Place the following script in the event out of the full date field. The value of the FormCalclanguage.

    Duedate.rawValue = Num2Date (Date2Num (complete.rawValue, "YYYY-MM-DD") + 45, 'YYYY-MM-DD');

    Thank you

    Srini

  • distant future dates in MAC Photos

    almost all my pictures are now published in the years 2052, 2051?

    How to recover / restore the original dates of photo?

    You can change the date by using the "set date and time" option in the menu 'Image '.

  • Need help on calculating 2 different date

    How to check the date 2 different (for example: 18/09/2015 10:28:30), excluding Saturday and Sunday.

    And example of the out come in different 4days9hours30min in total

    Here you go:

    select (select count(*)
        from
              ( select to_char(to_date('09/23/2015 07:13:47 PM', 'MM/DD/YYYY HH12:MI:SS AM')+level, 'DY') as dy
                  from dual
                  connect by level <= (to_date('09/23/2015 07:13:47 PM', 'MM/DD/YYYY HH12:MI:SS AM') - to_date('09/18/2015 10:28:30 AM', 'MM/DD/YYYY HH12:MI:SS AM'))
              )
        where dy not in ('SAT', 'SUN') ) "Day",
        trunc(mod ( (to_date('09/23/2015 07:13:47 PM', 'MM/DD/YYYY HH12:MI:SS AM') - to_date('09/18/2015 10:28:30 AM', 'MM/DD/YYYY HH12:MI:SS AM'))*24, 24)) "Hr",
        trunc(mod ( (to_date('09/23/2015 07:13:47 PM', 'MM/DD/YYYY HH12:MI:SS AM') - to_date('09/18/2015 10:28:30 AM', 'MM/DD/YYYY HH12:MI:SS AM'))*24*60, 60)) "Min",
    trunc(mod ( (to_date('09/23/2015 07:13:47 PM', 'MM/DD/YYYY HH12:MI:SS AM') - to_date('09/18/2015 10:28:30 AM', 'MM/DD/YYYY HH12:MI:SS AM'))*24*60*60, 60)) "Sec" from dual
    

    In addition, check below threads.

    The same question is asked and answered repeatedly on the same forum.

    Re: Jump for weekend days in SQL

    County of days between two dates without weekend

  • Calculation script, loading data in each block?

    Hello

    I have a calculation script that does not replace an existing value with 1000. It should not do anything if the value is 0 or #missing, but I found it load actually numbers on all the blocks without worrying. Am I wrong in something?

    :

    FIX (@RELATIVE(Dimension1,0), @RELATIVE(Dimension2,0))
    FIX (& CURRENT_SCENARIO, & CURRENT_YEAR)
    "ACC100")
    IF (ACC100! = 0 OR ACC100! = #Missing)
    ACC100 = 1000;
    ENDIF
    ENDFIX
    ENDFIX


    Any help will be appreciated.


    Kind regards

    you want to use AND it is not OR

    in your case it will always return the true value, it will not not 0 or may not be #MISSING.

    If you use, and it won't work if its not the 0 and not #missing

Maybe you are looking for

  • How do I put FF so hit enter in the address bar refreshes a page if it is already loaded?

    Currently FF do not reload a Web page if you re - enter in the address bar. For example, go to your address bar right now. Don't change anything and press ENTER. Note that nothing happens? Even if there was new data on the page, it would not show upw

  • Is there a software scan to fix corupted USB key?

    Hello I used the USB thumb drive initially to transfer a large amount of files on a hard drive from another PC. After that, I deleted all the files by deleting files. I then used to save a large number of internet download Midi files. After that, I'v

  • Numeric keypad problem

    Hello I'm porting sencha on BlackBerry. I want to display the numeric keypad that contains only numbers and characters of dot (.). I use xtype: 'numberfiled '. But it does not help, it shows the two sales and letters [A-F] and key dot does not come.

  • Windows 8 high disk caused by Tiworker.exe

    Do I need this, what is it? Can I remove it safely?

  • Expired the cloud creative conflict with Acrobat Pro DC?

    A version of Acrobat Pro DC 2015 newly purchased will download completely but an earlier version of Acrobat Pro of an expired creative cloud opens instead and says that it is expired. This new Acrobat Pro is installed on a Mac under OS El Capitan 10.