XQuery function : Adding day to current date

I have a requirement to add 1 day to the current date during the Xquery transformation.
Does anyone know if there is any xquery function that does that?
From this link,
http://download.oracle.com/docs/cd/E13214_01/wli/docs92/xref/xqdtopref.html#wp1162860
it seems like there is a function, op: add-yearMonthDuration-to-dateTime, that serve this purpose, but I don't find it in OSB console IDE nor OEPE.

You can use the below expression for adding 1 day (24 hrs) to a given current date:
fn:current-dateTime() + xdt:dayTimeDuration("PT24H")
Thanks,
Patrick

Similar Messages

  • Extract data on report between last 30 days from current date.

    Hi Experts,
    Ealrier i had provided user promt to select the date range, now i need to schedule the report for this i have to set the date between last 30 days from current date.
    How can i add this in formaula on record selection.
    before:
    {pm_process.pm_creation_date} in {@Start Date to UTC} to {@End Date to UTC}
    I tried:
    {pm_process.pm_creation_date} in CurrentDate() - 30 to CurrentDate()
    But this is diplaying me only data of 30th date from current date.
    Please advice.

    Hi Brian,
    Thank you!
    1. I have not created any function for {pm_process.pm_creation_date} in [CurrentDate() - 30 to CurrentDate()] i am just adding this on Record Selection and its not helping.
    2. {pm_process.pm_creation_date} in Last30Days; this is throwing below error.
    please advice what to be done?

  • I would like to format cells with time only.  when I enter a time of day the current date is still in the cell which is not necessarily so

    I would like to format cells with time only.  when I enter a time of day the current date is still in the cell which is not necessarily so.  THere are  no options for just  date .

    christine275 wrote:
    ... (this is a time worked by date and not always entered on the date worked)--
    "Time" in Numbers is always "Time of Day", and is always part of a Date and Time value. "Amount of Time" is a Duration value, which may be displayed in a similar format to "Time of Day," but is a different type of value.
    If you are entering the number of hours and minutes worked, format the column as Duration, set the units and the format in which you want to have the value appear.
    The Date column will still contain a Date and Time value (Jan 1, 2011 00:00:00 in the cell shown in the example), but the "Time Worked" cells will contain only a Duration value.
    Incidently, the Date in A2 was entered as "jan 1" (without the quotes). Numbers automatically adds the current year and the default time value, then displays the result in the closest format to what you've entered, or in the Date and Time format you have chosen.
    The Duration value in B2 was entered as 3:15 (as displayed). Note that in the entry bar the duration is displayed as 3h 15m, probably to distinguish it from a similarly formatted (Date and) Time value.
    Regards,
    Barry

  • Validation for posting date is less than 7 days of current date

    Hi
    I want to create a validation wherein  system will validate every entry that whether posting date is less than 7 days of current date. If it is than check in a set is that user id available if not than show error message.
    If someone have any idea on this logic pls share with me.
    Regd
    Shiv

    Hi,
    That's certainly possible via usual OB28 validation. Define your prerequisites for the posting date (you will have to do it via user-exit (bkpf-budat greater then sy-datum less 7 days) , and check whether the user is in the set.
    Regards,
    Eli

  • PL/SQL Function: Adding Days to Date

    I have a function that adds a given number of days to a date, and excludes Saturday, Sunday, or Monday if needed with parameters. The problem is when the given date is a Friday, you need to add one day, and you exclude Saturday and Sunday i.e. DAYSBETWEEN('30-SEP-11',1,1,1,0) or DAYSBETWEEN('30-SEP-11',1,1,1,1).
    Where am I going wrong here and what needs to be fixed?
    create or replace
    FUNCTION daysbetween(
          DAYIN  IN DATE ,
          ADDNUM IN NUMBER ,
          EXSAT  IN NUMBER ,
          EXSUN  IN NUMBER ,
          EXMON  IN NUMBER )
        RETURN DATE
      IS
        dtestart DATE;
        dteend Date;
        intcount NUMBER;
      BEGIN
      WITH all_dates AS
        (SELECT LEVEL AS days_to_add ,
          dayin ,
          dayin + LEVEL AS new_dt ,
          addnum ,
          exsat ,
          exsun ,
          exmon
        FROM dual
          CONNECT BY LEVEL <= addnum * 2
        exclusions AS
        (SELECT ROW_NUMBER() OVER ( ORDER BY new_dt) ordering ,
          addnum ,
          new_dt ,
          TO_CHAR ( new_dt, 'DY' )
        FROM all_dates
        WHERE 1                       =1
        AND TO_CHAR ( new_dt, 'DY' ) != DECODE ( exsat, 1, 'SAT', 'XXX')
        AND TO_CHAR ( new_dt, 'DY' ) != DECODE ( exsun, 1, 'SUN', 'XXX')
        AND TO_CHAR ( new_dt, 'DY' ) != DECODE ( exmon, 1, 'MON', 'XXX')
      SELECT MAX( new_dt ) INTO dteend FROM exclusions WHERE ordering <= addnum;
      RETURN dteend;
    END daysbetween;

    You could do something in SQL like this perhaps...
    SQL> ed
    Wrote file afiedt.buf
      1  with x as (select rownum as days_to_add from dual connect by rownum <= 31)
      2      ,y as (select sysdate as dt from dual)
      3  --
      4  -- end of test data
      5  --
      6  select dt, days_to_add
      7        ,case when to_char(new_dt,'fmDAY') IN ('SATURDAY','SUNDAY') then new_dt + 2
      8         else new_dt
      9         end as new_dt
    10  from (
    11        select dt
    12              ,days_to_add
    13              ,dt
    14               +floor(days_to_add/5)*7
    15               +mod(days_to_add,5) as new_dt
    16        from x,y
    17*      )
    SQL> /
    DT                   DAYS_TO_ADD NEW_DT
    05-OCT-2011 16:33:27           1 06-OCT-2011 16:33:27
    05-OCT-2011 16:33:27           2 07-OCT-2011 16:33:27
    05-OCT-2011 16:33:27           3 10-OCT-2011 16:33:27
    05-OCT-2011 16:33:27           4 11-OCT-2011 16:33:27
    05-OCT-2011 16:33:27           5 12-OCT-2011 16:33:27
    05-OCT-2011 16:33:27           6 13-OCT-2011 16:33:27
    05-OCT-2011 16:33:27           7 14-OCT-2011 16:33:27
    05-OCT-2011 16:33:27           8 17-OCT-2011 16:33:27
    05-OCT-2011 16:33:27           9 18-OCT-2011 16:33:27
    05-OCT-2011 16:33:27          10 19-OCT-2011 16:33:27
    05-OCT-2011 16:33:27          11 20-OCT-2011 16:33:27
    05-OCT-2011 16:33:27          12 21-OCT-2011 16:33:27
    05-OCT-2011 16:33:27          13 24-OCT-2011 16:33:27
    05-OCT-2011 16:33:27          14 25-OCT-2011 16:33:27
    05-OCT-2011 16:33:27          15 26-OCT-2011 16:33:27
    05-OCT-2011 16:33:27          16 27-OCT-2011 16:33:27
    05-OCT-2011 16:33:27          17 28-OCT-2011 16:33:27
    05-OCT-2011 16:33:27          18 31-OCT-2011 16:33:27
    05-OCT-2011 16:33:27          19 01-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          20 02-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          21 03-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          22 04-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          23 07-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          24 08-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          25 09-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          26 10-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          27 11-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          28 14-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          29 15-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          30 16-NOV-2011 16:33:27
    05-OCT-2011 16:33:27          31 17-NOV-2011 16:33:27
    31 rows selected.

  • Adobe LiveCycle Designer 8 - Add days to Current Date in another text field

    Hi-
    I am working on an expense report. I have six fields, CurrentDate, and countDate1 through countDate5. The CurrentDate is a Time/Date field which the user can select whatever date is needed with the drop down calendar. The other five countDate fields are "text" fields which will represent Monday through Friday. I would like to add zero days to whatever the user selects as the CurrentDate and make that appear in countDate1 which represents Monday(the CurrentDate the user selects will always be a Monday), add one day to whatever the user selects as the CurrentDate and make that appear in countDate2 which represents Tuesday...and so on. I realize this is probably basic for someone familiar with FormCalc but I'm very new at this.
    This got me very close but I want the user to select the date and not have the CurrentDate already filled in.
    CurrentDate - DateTime field, FormCalc calculation script:
    num2date(Date())
    Date1 - Text field, FormCalc calculation script:
    Num2Date( Date2Num(CurrentDate.formattedValue))
    Date2 - Text field, FormCalc calculation script:
    Num2Date( Date2Num(CurrentDate.formattedValue) + 1 )
    Thanks!
    Brian

    Here is an exmaple of adding days the script is used in the "exit" event for the date select field that has display format of "MM/DD/YYYY". Adding days requires add x number of days to the days since the epoch date for the current date, adding months or years one needs to manipulate the string parts of the date.
    ----- form1.#subform[0].InputDateField::exit: - (FormCalc, client) ---------------------------------
    // fomatted string for selected date
    var sFmtDateValue = $.formattedValue
    var sMsg = Concat("Entered date formatted: ", sFmtDateValue) // build message string
    sMsg = Concat(sMsg, "\u000a" ) // add new line to message
    // convert date string to days since epoch date - format is important
    var fDaysPast = Date2Num(sFmtDateValue, "MM/DD/YYYY")
    // add 7 days to days past epoch date
    var f7DaysPlus = fDaysPast + 7 // add 7 days
    var s7DaysPlus = Num2Date(f7DaysPlus, "MMM DD, YYYY") // format string for 7 days plus
    sMsg = Concat(sMsg, "\u000a", "Plus 7 Days: ", s7DaysPlus) // build message string
    // add 14 days to days past epoch date
    var f14DaysPlus = fDaysPast + 14 // add 7 days
    var s14DaysPlus = Num2Date(f14DaysPlus, "MMMM DD, YYYY") // format string for 7 days plus
    sMsg = Concat(sMsg, "\u000a", "Plus 14 Days: ", s14DaysPlus) // build message string
    // display results
    // work on months
    // get parts of date past epoch date
    var sFullYear = Num2Date(fDaysPast, "YYYY") // get 4 digit year form days past epoch date
    var sMonth = Num2Date(fDaysPast, "MM") // get month form days past epoch date as number
    var sDate = Num2Date(fDaysPast, "DD") // get date form days past epoch date as a number
    var s2Month = Sum(sMonth, 2) // add 2 months
    var s2FullYear = sFullYear
    // if more than 12 months in new date adjust year on number of months
    if (s2Month > "12") then
    s2FullYear = Sum(s2FullYear, + 1) // increment year
    s2Month = Sum(s2Month, - 12) // adjsut months
    endif
    var s2MonthsAdded = Concat(s2Month, "/", sDate, "/", s2FullYear) // date string
    sMsg = Concat(sMsg, "\u000a", "Added 2 months: ", s2MonthsAdded) // display stringxfa.host.messageBox(sMsg, "Sample Adding Days" ,3, 0);
    var s5Month = Sum(sMonth, 5) // add 5 months
    var s5FullYear = sFullYear
    // if more than 12 months in new date adjust year on number of months
    if (s5Month > "12") then
    s5FullYear = Sum(s5FullYear, + 1) // increment year
    s5Month = Sum(s5Month, - 12) // adjsut months
    endif
    var s5MonthsAdded = Concat(s5Month, "/", sDate, "/", s5FullYear) //build Date string
    sMsg = Concat(sMsg, "\u000a", "Added 5 months: ", s5MonthsAdded) // display stringxfa.host.messageBox(sMsg, "Sample Adding Days" ,3, 0);
    // display results
    xfa.host.messageBox(sMsg, "Sample Adding Days and Months" ,3, 0);

  • Function Module to convert Current Date & Time to Julain Date.

    Hi Guys,
                  Is there any Function Module for converting Current system Date to Julian Date.
    I only want a Function Module not any report program.
    Thanks......
    Sudheer.

    hiii
    i tried to find a FM for that but could not find any..ya after reading this thread i read about how julian date can be make..from this link only i read about Julian date
    and for this time is also needed but i think there is not any FM for this.still i am searching.let me know if you get any.

  • Adding days to a date

    Hi, i've been trying to add days to a date with no luck.
    I have two dates.
    Date date1= new Date();
    Date date2;
    I want date2 to equal x amount of days from date1.
    eg. date1 = 6/10/2004
    I want date2 to be 4 days from date1 so date2 would be 10/10/2004. i know this is very easy to do with the Calendar class but in my program it needs to be a Date because i parse Strings (dd/mm/yyyy) to Dates. It is not possible to parse Strings to Calendar date's right?
    So if anyone can help me add days to a Date object, it would be great!
    Thanks

    >
    testParse.java:33: 'void' type not allowed here
    System.out.println (testDate2.setTime(newTime));You are trying to print out the results of the void
    method, i.e. a void, not the object.
    d-unknown, if you look closely at the error message provided and the line it's complaining about, and use a little process of elimination, I think you'll find that there are only so many possibilities as to what possibly could be wrong.
    These compiler errors are not cryptic curses thrown up to stop people from getting work done, the counterspells to which are only known to those who have been through the rite of passage and had a coffee cup branded on their butts. The error messages are your friends. They tell you pretty precisely what went wrong and where if you take the time and effort to read an understand them.
    "'void' type not allowed here" -- Where have you ever seen the word void when programming Java? As the return type of a method, right? So, "'void' type" is probaby talking about the return type of some method.
    "not allowed here" -- well, it looks like you're doing something with a void where you can't have a void.
    There are only two method calls on that line--println and setTime. Both return void, so either one could be the problem. Either one might be being used where it's not allowed.
    But wait, what could possibly be wrong with where you're using println? It's just like every other println you've ever used.
    What about setTime? Well, println has several signatures. One takes object, and there's one for int, float, etc. So what you pass to println has to be one of those types. Is the return type of setTime an Object or int or long or anything? No, it's void. It's nothing. It has no value. println needs a value, but you're passing something that has no value. It would be like saying x=date2.setTime(...) It makes no sense, because a method with a void return type doesn't return any value.
    See, that wasn't so hard, was it? Yeah, it was wordy, but really if you start with "what could be void in this line and how could it be causing a problem," the thought process only has a few steps to get to the answer.

  • Get Date x number of days before current Date

    How do you subtract x number of days from a Date object?
    Is there a better way than
    int x = 28; // number of days
    long minisPerDay = 24 * 60 * 60 * 1000;
    Date newDate = new Date (oldDate.getTime() - (x * minisPerDay );

    > How do you subtract x number of days from a Date object?
    Calendar c = Calendar.getInstance();
    c.setTime(yourDateInstance);
    c.add(Calendar.DATE, -x);
    Calculating Java dates: Take the time to learn how to create and use dates
    Working in Java time: Learn the basics of calculating elapsed time in Java
    Good luck! :o)
    ~

  • Need help in adding days to a date

    Hi,
    In rtf when if condition is true I have to add 7 days for a particular date.
    I am using logic like this <?xdofx:DATE+07?>
    but it is giving output like if :date is 27-FEB-08 then it is showing output like 2715
    I also checked like this
    case1:<?xdoxslt:ora_format_date_offset(DATE,'7', ‘+’)?>
    case2: <?xdofx:round((to_number(to_char(DUN_DATE,'JSSSSS'))+to_number(to_char(to_date('07','YYYY-MM-DD'),'JSSSSS'))) div 100000)?>
    Still not working.
    Please help me how to do this?
    Thanks in advance

    you should use these functions
    <?xdoxslt:ora_format_date_offset(xdoxslt:sysdate(),2,’+’)?>
    <?xdoxslt:ora_format_date_offset(yourdate, offset or days, ‘operator + - ’)?>
    i guess , something better will come in future , when the xsl 2.0, is being supported here in bip

  • Adding days to the date field

    Hi,
    I have a scenario as below.
    I have to add no. of days to the exixsting date field in the program. The statement is like this.
               <b>DATE1 = DATE + XDAYS.</b>
    Where <b>DATE</b> is in <b>DDMMYYYY</b> format. and XDAYS holds the number of days which will be retrieved from the standard table. And DATE1 should hold the result date.
    <b>eg:</b> Let <b>DATE</b> = <b>30.08.2007</b>
               <b>XDAYS</b> = <b>15</b>
    DATE1 = DATE + XDAYS.   =>   <b>DATE1 = 30.08.2007 + 15</b>.
    <b>DATE1 = 14.09.2007</b>
    Is there any easiest way to do this. or is there any function mdule  to do this operation.
    I hope you understood the question. Please let me know if I need to be more clear.
    Thanks in advance.
    -Pradeep.

    Hi,
    The date will be in internal format of 8 digits... Like 20070830..
    Directly add the number of days.. system will automatcally calculate
    w_new = w_old + 15 (20070830 + 15)
    w_new becomes 20070914
    and when you will write this : WRITE : w_new. It will show 14.09.2007 or depending on your settings for the date format. No need to call any fm for this..
    Thanks and Best Regards,
    Vikas Bittera.
    **Reward if useful**

  • What is the best way to keep 7 days most current data in tabledata

    Hi,
    Can anybody help me to keep most recent 7 days data in a table? any data older than 7 days should be removed which cen be done once a day.
    What is the best way to do this? partition, re_create table or anything else?
    Thanks
    George

    Have you considered partitioning the table? You could then drop the oldest partition every day, which would be marginally quicker & easier than deleting the 10,000 rows. 100,000 rows is a pretty small table to partition, but it may be worth considering.
    I wouldn't expect there to be a significant difference on query performance no matter how you set this up. You won't reset the high water mark, but that is only important when you are doing a full table scan and Oracle will reuse the space for the current day's data, so it's not like the high water mark will be constantly increasing.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Adding days in prompt date

    Hi Guys
    I need to create the filter like:-
    user select the date using the prompt on report while opening the report and i need to use the date entered by user which will be compared as
    date > user_Selected_dt +14 days..
    i have created the prompt and in report i can see the date selected by user using UserResponse () function but how to put same in filter.
    regards

    Just create a formula in Webi, let's say "Date Filter" =
    if date > user_Selected_dt +14 days then "filtered rows" else "Display All"
    No you can use the 'Date Filter" in interactive filter or table filters or controls.

  • Adding days to a date object

    I am retreiving a date field from the database.
    i am retrieving that with getDate() method on the result set object.
    that is am retrieving as java.sql.Date object.
    on that date object i have to add 30 days and store it back in the
    database as a date field in database.
    How should i go about handling this problem.
    suppose
    java.sql.Date newDate=rs.getDate(1);
    on this newDate how can i add 30 days and store it back to the database.
    Plz help me out guyz.
    Thanks.

    wud the setting to a particuale date means setting to
    the date i retrieved from the database.
    How to set for a particular date.We have setTime()
    method in Calendar.
    but that takes util.Date object.Then do i have to
    convert the sql.Date object into a util.Date object.A java.sql.Date IS-A java.util.Date.
    (There's no such thing as a sql.Date or a util.Date unless you have a different API than the rest of us.)

  • Adding days to a date causes it to be set back a year.

    Hello,
    I have the following problem on Oracle 10g. I run the following statment that adds 1 year to a date but, unless I format it, the date comes back with one year less than it should.
    SQL> select effective_date, (effective_date + interval '1' year(1)) as addyear, add_months(to_date(to_char(effective_date, 'MM/DD/YYYY HH24:MI:SS'), 'MM/DD/YYYY HH24:MI:SS'), 12) as addyearformat
       from price_change
            where
            price_change_id = '794328'   ;
    EFFECTIVE_DATE  ADDYEAR         ADDYEARFORMAT
    28-SEP-09       28-SEP-08       28-SEP-10Has anyone else ever seen something like this?
    Effective_date is a date type and has data in the format 'MM/DD/YYYY HH24:MI:SS'. I think it is something with the format, maybe something to do with the time zone - not sure. If I just insert a value into the table with the format 'MM/DD/YYYY HH24:MI:SS' I don't have this problem. I don't know how the date could have been changed to cause this but I do know it goes through a time zone function before being inserted into this table though I don't know if that is causing the problem.
    Not sure if it matters but nls_database_parameters...
    PARAMETER VALUE
    NLS_DATE_FORMAT dd-mon-rr
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    Thanks for any help in advance.
    Edited by: amcgator on Oct 15, 2010 11:52 AM

    Funny, but I think somehow your dates are BC:
    with price_change as (
                          select to_date('28-SEP-09 BC','dd-mon-yy bc') effective_date from dual
    select  effective_date,
            (effective_date + interval '1' year(1)) as addyear,
            add_months(to_date(to_char(effective_date, 'MM/DD/YYYY HH24:MI:SS'), 'MM/DD/YYYY HH24:MI:SS'), 12) as addyearformat
      from  price_change
    EFFECTIVE ADDYEAR   ADDYEARFO
    28-SEP-09 28-SEP-08 28-SEP-10
    SQL> Issue:
    select  to_char(effective_date,'mm/dd/yyyy bc')
      from  price_change
      where price_change_id = '794328'
    /SY.

Maybe you are looking for

  • Can I delete my icloud back ups with out loosing my current data on my iphone 5

    Hey guys.  I was wondering if I can delete my iCloud backup  with out loosing my current data on my iphone 5?  I can not up date my phone because it says I do not have enough storage available.  Yes, I have purchased more storage space on iCloud.  Th

  • Error while deploying the Composite Application ERROR: (SOAPBC_START_1)

    Hi, I have a EJB web service created and deployed in GlassFish. I have created a BPEL which will recieve from the web service and then insert into a SQL table. To track the messages I have also created to File WSDLs to save the WS message and the DB

  • TS4062 Syncing with a new network/router

    I am having trouble on syncing on a new WIFI network. I moved and I have a new router with a new network name. Since that I cannot sync over wifi. On syncing options on the ipod says that I will be able to sync via wifi when "old network" is availabl

  • Streaming from multiple servers

    Hello, I have a server in Israel with Flash Streaming server installed. If I'll buy another server and host it in the US, what do I need to do in order to broadcast from it also. 1. Do I have to broadcast twice from the source or can I broadcast to o

  • Use of AI_DIRECTORY_JCOSERVER in PI7.0

    Hi All, There is one small doubt. As per my knowledge, In PI7.0 for RFC's we don't have any use of AI_DIRECTORY_JCOSERVER, only AI_RUNTIME_JCOSERVER does the task. Now my question is : What is the use of AI_DIRECTORY_JCOSERVER in PI7.0. Is it used th