How to subtract days from day

Hi,
how to subtract 18 days from day : 04-10-2004
rgds,
Karna

SQL> select to_date('04-10-2004','dd-mm-yyyy')-18 from dual
SQL> /
TO_DATE('0
16/09/2004
SQL>

Similar Messages

  • How to subtract time from dateTime in xquery?

    How to subtract time from dateTime in xquery??
    In ALDSP i tried to use the function xf:add-days but it is showing an error saying invalid function name. I think this namespace is not valid for ALDSP. Is there is any way to add this function in ALDSP???

    xquery functions and operators documentation is here :
    http://www.w3.org/TR/xpath-functions/
    It sounds like you want to ..
    op:subtract-dayTimeDuration-from-dateTime
    this is not an xquery function that you can call, it is an xquery operation defined by the specification
    I believe you can simply use the '-' operator to use that operation.
    <newDateTime>
    { $myDateTime - $myTime }
    </newDateTime>

  • How to subtract Time from Sysdate

    Hello,
    I want to subtract time from sysdate and get the sysdate with time.
    Example : = (Sysdate with time)03-mar-2002 16:40:55 - 8 (hours). The result should be like :03-mar-2002 08:40:55
    How to write a query for this?.
    Please let me know as soon as possible.
    Thanks,
    Ravi.

    Hi Ravi...
    SYSDATE includes time, TRUNC(SYSDATE) does not include time.
    If you subtract these two, you'll get a positive number of 1.00 or less which is the fraction of a day. For instance high noon would have a fraction of 0.50000. 12:01 p.m. would be 0.50000 + (1/(24*60)), or 0.50069444....
    If you want to set the clock back, by calculating a "date" that is 8 hours less than the SYSDATE, then SYSDATE - (8/24) will do that. This will work even if SYSDATE was something like 2 a.m., because it will then set it to 6 p.m. of the day before the day in SYSDATE.
    If you want to set a "date" to a specific time on the day of SYSDATE, then calculate the fraction for that time and add it to the TRUNC(SYSDATE). High noon would be TRUNC(SYSDATE) + 0.5.
    SELECT TO_CHAR(TRUNC(SYSDATE)+0.5,'DD-MON-YY HH:MI:SS am') AS NOON FROM DUAL;Hope this helps...
    Larry Johnson

  • Subtracting months from current date

    how to subtract months from current date in mysql

    You are in an Oracle forum, so the Oracle answer is: use add_months(sysdate,-2) to subtract two months from the current date.
    Regards,
    Rob.

  • How to subtract a day from the presentation variable @{system.currentTime}

    Hello,
    How can subtract a day from the presentation variable - @{system.currentTime}
    I use the above as a title in the report. However I want to subtract a day from the above variable. How can I accomplish it?
    Thanks.

    Hi,
    Did you try the steps which I mentioned above. You can use TIMESTAMPADD function in many places in your report but I think not in title section of the title view.
    Also you can try using Narrative view instead of title view to achieve this. Follow below steos:
    * Pull another column in the report and change its fx to TIMESTAMPADD(SQL_TSI_DAY, -1, @{system.currentTime})
    * Now go to the Narrative view and add the below text in Narrative section of the view.
    Active Person Report as of @1
    Here @1 assuming the new column created is placed before all the columns in the request.
    * Also set the 'Rows to Display' as 1.
    * Delete Title view from the report and this narrative view on top of your report.
    Hope this helps.
    Thanks

  • Regarding subtraction of 10 days from the current date

    Need to know how I can get 10 days subtracted from the current date before the report is excuted. This needs to appear in the selection screen before the report is excuted.
    The select option contains two fields the first field is the date which is 10 days subtracted from the current date and the next field is the current date.
    Please suggest.
    Thanks.

    Hi Dolly
    I had a same req before check that code:
    AT SELECTION-SCREEN OUTPUT.
    IF pa_older = 'X'.
    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
    EXPORTING
    date = pa_end  "<<<<< date or in ur case sy-datum
    days = '10'
    months = '00'
    signum = '-'
    years = '00'
    IMPORTING
    calc_date = pa_end1.  " <<< subtracted date
    ENDIF.

  • Subtract business days from date - calculated column

    Hello,
    I had a calculated column on a library that took two dates and found the difference between them in business days, but I am not sure how to subtract business days from a date...for instance I get a start date from a form and I need to
    subtract 10 business days from that date.
    Can anyone help?

    I've always resorted to Javascript/JQuery for that kind of function. I found an old fashioned loop worked the best for me - it supports going forward or backwards. I key it off of a change in a starting date, or sometimes a status change. My actual production
    code takes into account another list where we remove holidays and non-work days.
    newDate = getNextDate(newDate, -3);
    $("input[title='Date Due']").val((newDate.getMonth() + 1) + "/" + newDate.getDate() + "/" + newDate.getFullYear());
    function getNextDate(currentDate, offset) {
    // offset is business days
    var wkend = 0;
    var index = Math.abs(offset); // need positive number for looping
    var neg = true;
    if(offset >= 0) { neg = false; }
    var curDOW = currentDate.getDay();
    var nextDate = new Date(currentDate);
    for(var i=1; i <= index; i++) {
    nextDate.setDate(nextDate.getDate() + (neg ? -1: 1));
    var nextDOW = nextDate.getDay();
    if(nextDOW == 0) {nextDate.setDate(nextDate.getDate() + (neg ? -2: 1));} // Sunday
    if(nextDOW == 6) {nextDate.setDate(nextDate.getDate() + (neg ? -1: 2)); } // Sat
    // alert("offset is " + offset + "start: " + currentDate + ", next date is " + nextDate);
    return nextDate;
    Robin

  • Subtracting days from GregorianCalendar

    Hi there,
    How does one subtract, let's say, 7 days from a given GregorianCalendar instance. Let's say I want to set up two instances on GregorianCalendar. The first one has a known date, like so:
    int endYear = 2005;
    int endMonth = 7;
    int endDay = 6;
    GregorianCalendar endDate = new GregorianCalendar();
    endDate.set(endYear,endMonth,endDay);
    How do I set up a second instance of GregorianCalendar set to 7 days prior to the endDate instance?
    GregorianCalendar nearDate = new GregorianCalendar();
    What I want to do here is make a comparison with todays date (a third instance of GregorianCalendar that is set to todays date), to see if todays date is within the range between endDate and nearDate.
    Can someone please help?
    Alan

    Calendar today = new GregorianCalendar();
    Calendar nextWeek;
    today.setTimeInMillis(System.currentTimeMillis());
    nextWeek = new GregorianCalendar();
    nextWeek.setTimeInMillis(today.getTimeInMillis());
    nextWeek.add(Calendar.DATE, 7);
    if (otherCalendar.getTimeInMillis() >= today.getTimeInMIlis() && otherCalendar.getTimeInMillis() <= nextWeek.getTimeInMillis()) {
        // otherCalendar is between now and a week from now
    } Of course, the above tests for a 7 day stretch starting at whatever date and time it is now and ending at the same time a week from now. If you really want "any time today (Saturday), tomorrow, etc. through next Friday" then you'll need to adjust the hours, minutes, seconds, and millis to zero.

  • I purchased an iPad mini on October 10th.  I want to return it and get the new ipad mini retina when it comes out.  How do I do that if the new ipad mini release date isn't until "later in November", which is beyond the 14 days from my purchase date?

    I purchased an iPad mini on October 10th.  I want to return it and get the new ipad mini retina when it comes out. I am currently still within the 14 day return/exchange window but how can I exchange it if the new ipad mini release date isn't until "later in November", which would be beyond the 14 days from my purchase date?  If apple announces a new version of a product you just purchased but won't actually release it for more than 14 days, how can you possibly exchange the one you just bought?  Is my only option to return the one I bought on the 10th (so return by 10/24) and then not have an iPad until the new one is available for purchase?  Or would it make any sense to return the one I bought, get a new one, which would presumably have another 14 day return window, and then exchange THAT one for the new ipad mini w/ retina when it comes out (hopefully within that second 14 day window)?

    Call the apple store you got it from and ask them. Sometimes in the past they've extended the 'no questions asked return' but only Apple can tell you for sure.

  • How to calculate a number of calendar days from a start date (e.g. 60 days from 3/10/2012)

    How to calculate a number of calendar days from a start date (e.g. 60 days from 3/10/2012)

    DT,
    If the starting date is in Column A, and you want to calculate what the date would be 60 days later, in Column B, write in Column B:
    =A+60
    Couldn't be much easier.
    Jerry

  • How to get the first day in the month from a domain date ?

    Hi,
    I like to know how to get the first day in the month from a domain date?
    Thanks
    Stephen

    Hi Gokul...
    Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.
    Its similar to the above one but instead of writing case statement you can achive the following.
    data : w_res type i,
             w_data type d,
    w_res = w_date mod 7.
    w_date = w_date - w_res.
    write w_date.
    This works.
    Regards,
    Siddarth

  • I have downloaded Acrobat XI Pro as a 30 day free trial onto my iMac (Yosemite OS).  When I open the program using the Adobe icon, a screen appears showing a number of "ReadMe" files.  How do I proceed from here?

    How do I proceed from a screen showing a number of "ReadMe" files in order to open the Acrobat XI Pro program?  I downloaded a 30 day free trial of the program onto my iMac (Yosemite OS).

    What is the other file in that folder, not the Readme? Did you actually install the software yet? And did you read the Readme for instructions?

  • HT1296 how can i sync every day pictures from iphone to mac?

    how can i sync every day pictures from iphone to mac?
    i can only sync my app via itunes, and the pictures from my mac to iphone, and not the opposite

    Which Mac OS do you have adn which iPhoto do you have?
    Do you see Photo Stream on the left side of iPhoto?
    Appletini6
    im pretty sure iphoto is for importing. icloud is for photo stream.
    Yes but iPhoto can import directly via Photo Stream.

  • I can not find "app of the day" from app store on my ipod,how can i find and download it?

    i can not find "app of the day" from app store on my ipod,how can i find and download it?

    It is possible that the app was removed from the App Store. If so you will not be able to get it back, unless you have it downloaded on your computer.
    If you had downloaded it before and it is still in the store, you can go to the App Store app on your iPod and go to the Updates tab. Then you tap on "Purchased" and see if it is available to download from your previous purchases.
    Hope this helps!
    PSkilton

  • How do I calculate days from two different dates?

    Hi all,
    How do I calculate days from two different dates?
    my requirement is to pass the number of days to target field from two dates.
    Current date :  14/04/2010
    Standard date: 01/01/1957 is the standard = day 0
    Is it possible in graphical mapping with out  udf?
    Plz help me on this I have donu2019t have much knowledge on JAVA.
    Thanks

    Hi Yadav,
    Probably this is not the correct forum for XI / PI .
    You can post the same to...
    Process Integration (PI) & SOA Middleware
    Hope this helps.
    Regards
    Raj

Maybe you are looking for

  • Need help on which router to buy for my BB 8320

    Now i know 8320 is dated but at this point i am not planning to change anytime soon . So I have a router which is kinda old, it didnt really occur to me since it worked. When i got my bb 8320 i was in a hotel and i could connect through their wireles

  • Mac mini and Philips tv

    hello. I bought the mac mini and philips tv, but I get pink screen. looking at various forums that this is a known issue between apple and philips.is there  no solutions to this problem?

  • My mac book pro will not boot up

    my MBpro will not boot up when turned on, it continues the reading process, and just continues to run.  I would like to power up using control keys, and bypass loading programs or a testing mode.

  • Airplay Direct is already on sale?

    I was expecting the launch of Airplay Direct during the event in which the Iphone5 came to public. It really was launched by Apple on that day? I am a professor and I need a device to do presentations wireless, but not in a TV. In Brazil most of the

  • T.CODE F-37

    Hi Please provide the path for transaction code F-37 (Customer Down Payment Request) Thanks Mohit