++ Adding the number of days to an existing date

Hi team,

Try to add the number of days to an existing date.

Ex: If the date is May 28, 2012, I need to add 15 days. The deadline in the element should be June 12, 2012.

How to handle this in Application Express 4.1.0.00.32.

Would appreciate your answer by May 29, 2012.

Thank you in advance.

Kind regards
Anitha

What is the date format in the date picker? Maybe give example date value

I guess it's something to your data format

Look at this example of work

http://Apex.Oracle.com/pls/Apex/f?p=46417:9

login: test/test

If your date format DD-MON-YYYY is then use this js code

//define the array of month names
var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
     "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var dateArray = $v('P2_WPTG_START_DATE').split("-");
for (var i = 0; i < monthNames.length; i++) {
     if (monthNames[i] == dateArray[1]) {
          var vmonth = i;
          dateArray[1] = vmonth;
     }

}
var d = new Date(dateArray[2], dateArray[1], dateArray[0]);
//convert the string into date
d.setDate(d.getDate() + 15);
// add 15 days
var newDate = (d.getDate()) + "-" + monthNames[d.getMonth()] + "-" + d.getFullYear();
$s('P2_PLANNED_RELEASE_DATE',newDate);

Tags: Database

Similar Questions

  • Is it possible to do it in a table? (Count the number of days from a certain date)

    Hello

    I did yesterday a data base to make my job easier. I could make it even more effective if I could understand this delicate piece of business.

    What I have is in my table has a column called "Date completed". This column contains the date when the project was completed. Then, I would like to have another column in the table called "number of days elapsed since completion. This column would have simply taken the date in column "Date completed" and count the number of days since that day and show them in a numeric value (i.e. 28). This way I could do a select and display everything is over for a number of days where I need complete my report (s).

    Thanks for any help. If you know a way to do that is completely different from what I'm trying to please do not hesitate to propose a solution, I'm a complete newbie to this. I took a basic SQL course at the College a few years ago, but never learned to do anything as advanced as this.

    Thanks again

    Your number of days can be easily calculated as trunc (sysdate) - date you completed column.

    You probably don't want to store the number of days in the table (since his will change daily)-instead it calculate on the fly that you query the data (or if you have 11 g you could watch the virtual to make columns persistent calculation rather than the value in the table).

  • You will need to add the number of days to the end date of the users.

    Hello
    I have a code where we adding the number of days (30) to the current date and update IDM DB user end date.
    Now, we have a requirement to add the number of days (30) to the existing fence of user instead of add to the current date.

    * public String incrementDate (int daysToAdd)
    {
    Start date
    log.info("NotifyLastDayOfService::incrementDate(): entrez»);
    SimpleDateFormat sdf = new SimpleDateFormat ("yyyy-MM-DD 00:00:00");
    Calendar c = Calendar.GetInstance ();
    c.Add (Calendar.DATE, daysToAdd); number of days to add
    String PROMOTIONDate = sdf.format (c.getTime ());
    log.info("NotifyLastDayOfService::incrementDate(): sortie»);
    return Nouvelle_date;
    }*/

    Have any body set up this scenario?
    Please suggest.


    Thank you
    Kalpana.

    You can try this as well

    where oimAttribute = "Users.End Date"

    public String updateOIMAttributeForDateType (String oimAttribute, Date endDate, long take, String daysToAdd)
    {
    tcUserOperationsIntf userOperationsIntf = null;
    HashMap modifyMap = new HashMap ();
    HashMap searchmap = new HashMap ();
    SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-DD hh: mm :"); ")
              
    try {}
    Calander cal = null;
    cal.setTime (endDate);
    Cal.Add (Calendar.DATE, Integer.parseInt (daysToAdd));
    Date Edate = cal.getTime ();

    modifyMap.put (oimAttribute, Edate);
    searchmap.put ("Users.Key", String.valueOf (take));
    userOperationsIntf = Platform.getService (tcUserOperationsIntf.class);
    tcResultSet searchset = (searchmap) userOperationsIntf.findAllUsers;
    userOperationsIntf.updateUser (searchset, modifyMap);
    return a SUCCESS;
    } catch (Exception e) {}
    If (Logger.isErrorEnabled ()) logger.error (e.getMessage ());
    error return;
    } {Finally
    try {}
    If (userOperationsIntf! = null) userOperationsIntf.close ();
    } catch (Exception e) {if (logger.isErrorEnabled ()) logger.error (e.getMessage ()) ;}}
    }

  • is there a way to display the value of the "number of days to the stadium' in communication?

    given that 'number of days at the stage' appears in the historic area and analytics, can we get the value to display in the review section?

    We have an oppo report which comes from the reports section because we need current data, but we also need to display the "number of days at the stage", which is only seen in the analytical section.

    Hello Janet,.

    It is rather lengthy to explain. I recommend you to get the book "CRM on demand report - Michael D.Lairson" it's a great book covering analytics in every detail.

    In the meantime, here's an excerpt from the book:

    Page (400)

    The combination of reports in a single report

    There are many common situations where you may find that you need a combined analysis.
    Some of them do not have access to all the columns of data in a single domain, with data
    missing lines due to a natural inner join which causes the report to abandon the lines where it not associated
    value exists in another table, or having several columns of the same type that you want to
    display in a single column.

    To create a combined analysis, first create a new report, based on the most appropriate subject
    area, add all the columns you want displayed in your report. It's a good idea to move forward
    and define the order of the columns now, because it's a bit more complicated to do so after the combination
    the report with another report.

    In step 1 of the window of generation and analysis, expand the section advanced down
    of the window. Click the combine with similar analysis button to open a list of all subjects
    (see Figure 15-3). You can select a different domain or the same field, you are already
    in collaboration with. Click the topic of your choice.

    The window that appears, shown in Figure 15-4, includes a few new items. Set operations
    section now contains three links: the link to columns of results and criteria for your original links
    report columns and the columns of your newly added report. The columns of the article shows the
    columns of the report based on the link selected in the operations section.

    The results columns are columns that will appear in the final report of the combination
    the criteria columns. You will notice that when you have selected the columns of results across
    Operations, each specified column section in the columns section has the properties of the columns, change
    Form and Order By buttons that you're used to seeing in your columns of the report. The
    formulas in columns of results are empty, however.

    Click on the first link of criteria, and you will see the columns that you added to your report.
    Notice that each column contains now that the button change the formula. The columns that will be

    Read Page (401) in the rooms - courtesy of Google Book Search. All of this is taken from the book, but should give you enough information to get what you are looking for.

    http://books.google.co.uk/books?id=OnbYrkWa4RsC&pg=PA404&lpg=PA404&dq=CRM+On+Demand+-UnionReport&source=bl&ots=qxxnaCWoqV&sig=3P23kMIl-4IIz324jQwZZ6oHb6U&hl=en&ei=qlBtTJ-3GNO4jAe7-fj7CA&sa=X&oi=book_result&ct=result&resnum=1&ved=0CB4Q6AEwAA#v=onepage&q=CRM%20On%20Demand%20-%20Union%20Report&f=false

  • Count the number of days of previous instance entity

    Hello

    My context, global and one of many relationship which is a list of contracts.

    I think I can explain my problem with an example:

    Contract 1:

    Start date: 01/01/2013

    End date: 31/03/2013

    2 contract:

    Start date: 05/01/2013

    End date: 31/08/2013

    Contract 3:

    Start date: 11/01/2013

    End date: 31/03/2014

    I want to do this:

    For contract 3, calculate the number of days for contract 1 + contract 2 + 3 contract

    For the market 2, calculate the number of days for the 2 + 3 on contract market

    To contract 1, calculete number of days for contract 1

    Moreover, I would calculate the number of days limited to 28 months before the date of the end of each contract.

    For contract 3 calculate the number of days until the 31/03/2014 but on 30/11/2011.

    Means that

    -If a contract of 4 ends before 30/11/2011-> not taken

    -If a contract of 4 begins on 11/01/2011 and ends on 15/12/2011, the days of the 12/01/2011 to 15/12/2012 are taken into account.

    For contract 2 calculate the number of days until the 31/08/2013, but since 30/04/2011.

    Means that

    -If a contract of 4 ends before 30/11/2011-> not taken

    -If a contract of 4 begins on 11/01/2011 and ends 15/12/2011-> not taken

    Hope my explanation is clear.

    I don't know how mixt:

    temporal reasoning

    reasoning of entities

    through the reasoning of entities

    as

    -for a contract, I have to see all deals before and not one after (cross entities reasoning)

    -I have to count a number of days, but if there is a period without a contract that I have to ignore days (temporal reasoning)

    Then I am quite lost.

    If anyone can help me in this situation aprehendate the appropriate.

    Thank you.

    Hey guys I think I found the solution, here my idea in french (sorry my client is franco-french):

    the contract if course of est en

    Temporelencoursouapres (contract start date)

    and

    TemporelEnCoursOuAvant (date of end of contract)

    a contract is being so

    Exists (employment of the applicant, the contract is ongoing)

    the value of the number of days to count pour the contract to determine the last date of end of contract to take into account

    0

    TemporelAvant (InstancesMinimum (employment of the applicant, the start date of the contract))

    0

    TemporelAvant (the start date of the contract to determine the last date of end of contract to take into account)

    0

    Temporelapres (InstancesMaximum (employment of the applicant, the end date of the contract))

    0

    Temporelapres (date of end of contract)

    0

    Temporelapres (the end date of the contract to determine the last date of end of contract to take into account)

    3

    the day is the last day of February

    and

    Temporelencoursouapres (the start date of the contract to determine the last date of end of contract to take into account)

    and

    a contract is underway

    1

    No (the day is the last day of February)

    and

    Temporelencoursouapres (the start date of the contract to determine the last date of end of contract to take into account)

    and

    a contract is underway

    0

    otherwise

    the value of the number of days through contracts pour prescribe the last contract end date to take into account = Temporeldatedepuisdebut (all jobs of the applicant, the date (the number of months to be taken into account for the period affiliation) months before the end date of the contract, the value of the number of days from paying the contract to determine the last date of end of contract to take into account)

    the duration of contracts from pour prescribe the last contract end date to take into account = IntervalleSommeQuotidienne (the start date of the contract to determine the last date of end of contract to be taken into account; AddDays (InstancesMaximum (employment of the applicant, the end date of the contract) 1); the value of the number of days through contracts pour prescribe the latest end date of contract to take into account)

  • Calculate fees that pay based on the number of days in a month

    Hello

    I'm writing the BR to fresh wages, based on the number of days in the month.

    Fix(Jan:DEC)

    "Salary" = ("Annual salary"-> "BegBalance" / 12) * "workforce";

    The existing calculation was ' wages divided by months no .of (12) ", now instead of number months wages that need to be calculated ("BegBalance"/ No..) OF DAYS IN THE MONTH) * 12.

    Can someone pls guide me, how to begin writing the BR for 'No. DAYS OF THE MONTH.

    You can do an admin enter number of days in the month. I remember CL reminding me the rhyme thirty days has September - Wikipedia, the free encyclopedia

    Jokes aside, you can use SQL to get the number of days. You will get different options for SQL and Oracle.

    If you want to continue to do this in BR then

    Fix(Jan:DEC)

    IF (@ISMBR (SEP) OR @ISMBR (Apr) OR @ISMBR (Jun) OR @ISMBR (Nov))

    ("Salary" = ("annual salary"-> "BegBalance" / 30) * 12) * "workforce";

    ELSEIF (@ISMBR (Jan) OR @ISMBR (Mar) OR @ISMBR (May) OR @ISMBR (July) OR @ISMBR (Aug))

    ("Salary" = ("annual salary"-> "BegBalance" / 31) * 12) * "workforce";

    ELSE (@ISMBR (Feb))

    IF (@Remainder($CurrYr/4) == 0)

    ("Salary" = ("annual salary"-> "BegBalance" / 29) * 12) * "workforce";

    ON THE OTHER

    ("Salary" = ("annual salary"-> "BegBalance" / 28) * 12) * "workforce";

    ENDIF

    ENDIF

    ENDFIX

    Concerning

    Celvin

    http://www.orahyplabs.com

    Post edited by: CelvinKattookaran

  • Setting to change the number of days to sync e-mail

    Where the parameter move to if you want to change the number of days that will be synchronized to your e-mail accounts? Or he is let out iOS 10 for some reason any?

    vrmcw wrote:

    Where the parameter move to if you want to change the number of days that will be synchronized to your e-mail accounts? Or he is let out iOS 10 for some reason any?

    account settings - sync mails - 'Exchange' on my phone - spam day-

    Not an ios 10 issue that I don't have the function to my yahoo account.

    Maybe you should ask your email provider.

  • How to increase the number of days before deleting messages in the trash?

    The automatic removal of e-mails to the trash is set for about 3 days. Much too short an e-mail should be necessary.

    In the left column of the files right click Trash. Select them properties. Click on the retention policy tab. Uncheck the box if it is enabled. Select the number of days you want to keep before deleting.

  • Count of the number of days in a calendar month according to the year

    Hi all

    On my table, column 1 is the list of months over several years.

    Column 2 is the activity number od each month.

    Column 3 I want an average rate of activity per day during the month, which should be: (C2 / number of days according to C1) %

    Problem: I can't find a fomula give me the number of days, particularly in February when the year is leap.

    Any help is appreciated.

    Thank you all,

    Lopez

    PS: by the way, with this new version of Apple Comunity I seem to have lost my previous questions about the numbers.

    Hey Lopez,

    EOMONTH(A1,0) (end of month) will GET help you.

    Column B is Date & time format to display only the month and year (actually the 1st of the month, but the day is not displayed).

    Formula in C2 (fill down)

    = EOMONTH(B2,0)

    The end of the month 0 months later.

    Formula in D2 (fill down)

    = DAY (C2)

    February 2015 (non-leap years) shows 28

    February 2016 (leap year) shows 29

    Kind regards

    Ian.

  • In Firefox you get 4 how changing the expiry of browser history. It was easy until there was a counter to set the number of days to keep a history? Lizzie

    In tools, under the protection of personal information, I was able to set the number of days during which the browser history... Very handy when you need to keep a record of sites visited. Now in Firefox4 I have "Remember history" option. How will I know how the newspaper story is saved for the moment?

    In Firefox 4 you can no longer set the number of days of historic preservation. The method used by Firefox to store history has changed, for more details on the changes, see http://blog.bonardo.net/2010/01/20/places-got-async-expiration

  • TouchPad email synchronizes the number of days back?

    I use gmail folders and it's my tool of the Organizer. It seems the touchpad syncs email only for a few days. Is this correct? On my pre, I think I can put the time and records contain the mails that I need. The TouchPad seems to have no such settings. Does anyone know the actual synchronization time and if I missed the way to fix this? Thanks for any help.

    It is an option. Go to your preferences and accounts, select the email and then account under "sync"criteria, you can select the number of days worth of e-mails it will hold.

    Alan

  • Find the number of days between the dates...

    Hi friends,

    I am new to this development of blackberry applications so I do not know how to find the number of days between two days. Y at - there any API is avilable otherwise we have to write our own code. In fact, I tried GregorianCalendar but I get error that cannot find the symbol but I already imported net.rim.device.api.util and package java.util also... Please give an idea how to solve this problem.

    with respect,

    s.Kumaran.

    Use DateField class instances to represent dates on the screen.

    And your code will be as follows:

    long date1 = date1DateField.getDate ();

    long date2 = date2DateField.getDate ();

  • Calculate the number of days remaining until the next anniversary. Help, please!

    Hi guys,.

    I'm new to the forum and to the development of BB. So please do not judge harshly if the answer to my question seems obvious.

    I need to calculate the number of days until the next birthday (taking into account any valid birth date)

    After looking at the API and the forum search, I realized that I could

    calculate the difference between two dates in milliseconds and then divide the delta of the value of a day in milliseconds. That is to say:

    birthdayCalendar.set (Calendar.YEAR, those);

    Date1 = birthdayCalendar.getTime () .getTime ();

    date2 = System.currentTimeMillis ();

    Delta = date1 - date2

    numOfDays = delta\DateTimeUtilities.ONEDAY

    Here's my question. How do I create a valid date1 what about leap years?

    Maybe there's a better way to solve this problem?

    Any help is greatly appreciated.

    I agree that the determination of the number of days between today and Feb. 29 could be a little difficult, if it is not a leap year.  I suspect that the calendar has a certain built-in mechanism to compensate for this, but your solution to choose a date is better.

    DST has a role to play, and Yes, the calendar makes up for it.  Let us take two dates, for example (before DST) March 1 and June 1 (after the DST).  If you take a calendar and set the same hour, minute, etc., they are all the same except for dates, then subtract one from the other, and then divide by the number of milliseconds in 1 hour, you calculate the number of hours between the same time on two different days.  You will find that it is not a multiple of 24 hours - because there is actually an hour less than the number of days since the clocks move forward (in the northern hemisphere anyway...),

    In your case, you are not calculating the number of hours, you calculate the number of days.  But you will be dividing by [24 * (time in an hour)].  If you take [23 * (time in an hour)] and divide it by [24 * (time in an hour)], using arithmetic on integers, you will end up 0.  The easiest to get around this, who also works for the end of the DST too, is to simply add one hour to the date before the division.

    Hope that makes sense...

  • Gets the number of records in the report based on the input of the user on the date and the number of days.

    Hello

    I need where there are quick dashboard that selects the date, second interval column consists of >, <, = and the third column is seen number (in days)

    for example, the user enters: 12 18, 2015, <, 9. here I report who should get the data (records) 9 days earlier from the date specified (from 12/10/2015 to 18/12/2015).

    Similarly for > =.

    How to get there. I'm unable to write the script and I use the column date in my report. Ask that you please advice how to solve this problem.

    Please find below the screen for reference.

    timediff.jpg

    Kind regards

    Chandra Khalil.

    Hello

    Not exactly why you're doing the report this way. If the user must select, basically, a period of dates, would not easier to have a column of data with a between the operator and the user would select 2 dates (upper and lower intervals)?

    In any case, it is possible to achieve what you want to do as a result of your approach. You could use when's CASE and have a more complex filter, but I think that it is better to have a few nested filters where you use the range operator to determine what date filter that you use (see image below)

    Some notes about my filter. First of all, I am making the assumption that the operator is "=", then the number of days specified must be ignored and you just return the data for the selected date. You will notice also that in my filters, I got a cast so far, but if you are using a column that is already a timestamp so it won't be necessary.

    This should achieve what you want.

    See you soon,.

    Pedro

  • Dynamic calculation of the number of days between two dates in a table

    Hello

    I'm working on request where I dynamically calculate the number of days between two dates in a table.

    The calculation must be dynamic, i.e., when I recover the Start_date and End_date and move to the field following (call_duration) in the same row, the difference must be calculated dynamically in this area and make sure the field read-only.

    APEX version: 5.0

    Hi BO123,

    BO123 wrote:

    Hello

    I'm working on request where I dynamically calculate the number of days between two dates in a table.

    The calculation must be dynamic, i.e., when I recover the Start_date and End_date and move to the field following (call_duration) in the same row, the difference must be calculated dynamically in this area and make sure the field read-only.

    APEX version: 5.0

    one of the way to do this by calling ajax on change of end_date.

    See the sample code given below to fetch the resulting duration and making the field read only after calculation

    Step 1: Change your page

    under CSS-> Inline, put the code below

    .row_item_disabled {
      cursor: default;
      opacity: 0.5;
      filter: alpha(opacity=50);
      pointer-events: none;
    }
    

    Step 2: Create on demand Ajax process I say CALC_DURATION

    Please check Procces Ajax, see line 6.7 How to assign a value to the variable sent by ajax call

    Declare
      p_start_date  date;
      p_end_date    date;
      p_duration number;
    Begin
      p_start_date  := to_date(apex_application.g_x01);
      p_end_date    := to_date(apex_application.g_x02);
    
       --do your calculation and assign the output to the variable p_duration
      select p_end_date - p_start_date into p_duration
        from dual;
    
      -- return calculated duration
      sys.htp.p(p_duration);
    End;
    

    Step 3: Create the javascript function

    Change your page-> the function and the declaration of the Global Variable-> put the javascript function

    You must extract the rowid in the first place, for which you want to set the time, see line 2

    assuming f06, f07 and f08 is the id of the start date, and end date columns respectively, and duration

    See no line no 8 how set the value returned by the process of ajax at the duration column

    Replace your column to the respective column identifiers in the code below

    function f_calulate_duration(pThis) {
      var row_id  = pThis.id.substr(4);
      var start_date = $('#f06_'+row_id).val();
      apex.server.process ( "CALC_DURATION", {
      x01: start_date,x02: $(pThis).val()
    }, { success: function( pData ) {
    // set duration to duration column
    $('#f08_'+row_id).val(pData);
    // disable duration column
    $("#f08_" + row_id).attr("readonly", true).addClass('row_item_disabled'); }
    });
    }
    

    Step 4: choose the end date call the javascript function

    Go to report attributes-> edit your Date column end-> column-> Attrbiutes element attributes-> put the code below

    onchange="javascript:f_calulate_duration(this);"
    


    hope this helps you,

    Kind regards

    Jitendra

Maybe you are looking for

  • Why cannot display graphic for me on a Web site

    I was running Firefox fine until today, when I noticed no. websites that I went to display all the graphics at all. Not even the firefox home page where is the download link, firefox logo that is normally he does not appear. Do not see the logo of go

  • How to change Vista German to English?

    Hello During a recent visit, I bought a laptop in Germany with Vista Home Premium.The display language is German.I don't understand German, and I live in East Africa. How can I change the language without having to buy another copy of Windows? Help,

  • A person or group has taken over my computer

    A few years ago, I downloaded accidentally malware/trojan/virus through a flash update. My internet has sent almost as much as she gets slow my computer down to ridiculous.  A few years ago I enabled hidden files and found a whole bunch of very stran

  • Page HP Diwali Utsav redemption is not available

    Hello I bought a new laptop HP on Diwali and my dealer told me that I'd get 3 years free warranty of HP under Diwali offer but I have to fill in the details online on the HP redemption page to avail the freebee and have also suggested me to go to thi

  • Windows Excel task bar

    Is there a way to separate many Excel Windows in the taskbar? I can already see each Excel windows; However, they always seem to be "fixed" in the taskbar. If I try to move one of the reduced Excel (or Word) in the bar of tasks, all windows to move t