Adding one day to a month

Hi,
I would like to add one day to a date. It seems like such a simple thing yet I have only found how to add a day to sysdate (or to add months to a given date).
Any help?
Thanks.
Leah

Hi,
If you want a specific date then it should be in date type,
so you cannot do: '01-MAR-2011'+1
but you can do: to_date('01-MAR-2011')+1
it seems to me that you just tried to add 1 to a string looking like a date
Tamir

Similar Messages

  • Check if a license exists for at least one day in each month

    How to check if a license exists for at least one day in each month for a given period ? Example : If we have a review period from Jan 25 2009 to Aug 15 2009. How to check if there is license for at lease one day in every month.

    Hi,
    Welcome to the forum!
    (1) construct a table or result set that has one row per month in the review period. [This thread|http://forums.oracle.com/forums/thread.jspa?messageID=3651350?] has a similar problem.
    (2) outer-join your actual data to that result set
    (3) use the aggreagate COUNT (x) function (where x is some column from your table) to see if there were any matches in each month. GROUP BY months.
    For a more specific answser, ask a more specific question.
    Post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data.
    It never hurts to say what version of Oracle you're using.
    Edited by: Frank Kulash on Jul 28, 2009 1:54 PM
    Maybe something like:
    WITH  all_months  AS
         SELECT     ADD_MONTHS ( TRUNC ( &period_begin_date
                                , 'MM'
                      , LEVEL - 1
                      )         AS month_date
         FROM    dual
         CONNECT BY  LEVEL <= 1 + CEIL ( MONTHS_BETWEEN ( &period_end_date
                                                          , &period_begin_date
    SELECT       m.month_date
    ,       CASE  COUNT (l.license_date)
                WHEN  0  THEN  'Nothing this month'
                          ELSE  'Some licenses issued'
           END     AS summary_txt
    FROM            all_months     m
    LEFT OUTER JOIN     license_table     l     ON  m.month_date     = TRUNC (l.license_date, 'MM')
                                     AND l.license_date     BETWEEN  &period_begin_date
                                                AND      &period_end_date
    GROUP BY  m.month_date
    ORDER BY  m.month_date
    ;Untested

  • Query to exclude just one day from a month/months.

    I'm sorry if a thread about this already exists i tried searching for it but couldnt find it. My question is as follows:
    I want to write a query which would fetch all the data from the month of Jun and July excluding Jun 29th. Is there a way to write a query without a subquery or function? If not then a subquery and a funtion query would work also.
    Thanks for you help.

    SQL> select date '2007-05-31' + level day from dual connect by level <= 61
      2  minus
      3  select date '2007-06-29' from dual
      4  /
    DAY
    01-06-2007 00:00:00
    02-06-2007 00:00:00
    03-06-2007 00:00:00
    04-06-2007 00:00:00
    05-06-2007 00:00:00
    06-06-2007 00:00:00
    07-06-2007 00:00:00
    08-06-2007 00:00:00
    09-06-2007 00:00:00
    10-06-2007 00:00:00
    11-06-2007 00:00:00
    12-06-2007 00:00:00
    13-06-2007 00:00:00
    14-06-2007 00:00:00
    15-06-2007 00:00:00
    16-06-2007 00:00:00
    17-06-2007 00:00:00
    18-06-2007 00:00:00
    19-06-2007 00:00:00
    20-06-2007 00:00:00
    21-06-2007 00:00:00
    22-06-2007 00:00:00
    23-06-2007 00:00:00
    24-06-2007 00:00:00
    25-06-2007 00:00:00
    26-06-2007 00:00:00
    27-06-2007 00:00:00
    28-06-2007 00:00:00
    30-06-2007 00:00:00
    01-07-2007 00:00:00
    02-07-2007 00:00:00
    03-07-2007 00:00:00
    04-07-2007 00:00:00
    05-07-2007 00:00:00
    06-07-2007 00:00:00
    07-07-2007 00:00:00
    08-07-2007 00:00:00
    09-07-2007 00:00:00
    10-07-2007 00:00:00
    11-07-2007 00:00:00
    12-07-2007 00:00:00
    13-07-2007 00:00:00
    14-07-2007 00:00:00
    15-07-2007 00:00:00
    16-07-2007 00:00:00
    17-07-2007 00:00:00
    18-07-2007 00:00:00
    19-07-2007 00:00:00
    20-07-2007 00:00:00
    21-07-2007 00:00:00
    22-07-2007 00:00:00
    23-07-2007 00:00:00
    24-07-2007 00:00:00
    25-07-2007 00:00:00
    26-07-2007 00:00:00
    27-07-2007 00:00:00
    28-07-2007 00:00:00
    29-07-2007 00:00:00
    30-07-2007 00:00:00
    31-07-2007 00:00:00
    60 rijen zijn geselecteerd.Regards,
    Rob.

  • Adding one day to a oracle.jbo.domain.Date and truncating the time part

    JDev 11.1.1.4.0
    Hello
    I need to add a day to oracle.jbo.domain.Date and get back a oracle.jbo.domain.Date without the time part.
    So far I've got
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    Date newDate = new oracle.jbo.domain.Date(new Timestamp(cal.getTime().getTime()));This adds 1 day to the date but keeps the time part of the date.
    How do I get rid of the time part of the date ?
    Thanks
    Paul

    The Calendar class allows you to set or clear each field.
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    cal.clear(Calendar.HOUR);
    cal.clear(Calendar.MINUTE);
    cal.clear(Calendar.SECOND);
    cal.clear(Calendar.MILLISECOND);
    Date newDate = new oracle.jbo.domain.Date(cal.getTimeInMillis());should work.
    Timo

  • On my iPad 3, how do I make calendar items lasting more than one day appear as such on the monthly view of my calendar? Right now only the first day of the item appears.

    On iPad 3, all of my calendar items lasting more than one day do not appear correctly when looking at the monthly view of the calendar; only the first day of the appointment appears. For example, if I am taking a vacation for 4 days, only the first day of the vacation is marked on the calendar, instead of being listed on all 4 days. When I look at the weekly view, however, it is correct and is listed on all 4 days. The problem here of course is that at a glance, there is no way to look at my monthly schedule. On my iPhone, everything is correct, regardless of month or week view, so clearly this is an iPad problem I guess? Please advise on how this can be corrected. Thank you!

    Unfortunately you can't do what you want. Many people have complained to Apple about this. I suggest you provide Apple feedback directly at http://www.apple.com/feedback/macosx.html. They will not provide a direct response but hopefully if enough people provide feedback Apple will fix this.

  • Successive dates with  last day of that month being added to succesive date

    Hi ,
    I have a piece of code that displays the succuessive dates from the given date to tilll date with a date interval of 30 days. My requirement goes some thing like this. since the given date is '26-nov-08' the next successive date should be the number of days in nov(30) added to '26-nov-08'. that will be around 26-dec-08. For this date it has to add the number of days in December(31) to '26-dec-08' and that turns out to be '26-jan-09'. and this must go on till date.
    In the below code i have used 30 for the interval of 30 days but the interval has to the last day of the successive date's month( for dec the interval has to 31 and for january the interval has to be 31 and for february 28)
    select to_date('26-nov-08', 'dd-mon-yy') + (level - 1) * 30
    from dual
    connect by level <= trunc((sysdate-to_date('26-nov-08', 'dd-mon-yy'))/30 )Please advice

    hi ,
    the query sent by you is correct and could it be in corporated for this query :
    SELECT TRUNC(inst_due_date) + (LEVEL-1 ) * (ilpa_term_type),iloan_code,LOAN_AMT,FEE_AMT,
    LOAN_DATE,LOAN_STATUS_ID
    FROM (
    SELECT inst_due_date,sm.iloan_code,LOAN_AMT,
    FEE_AMT,
    LOAN_DATE,
    LOAN_STATUS_ID,
    decode(sm.ilp_term_type, 26 ,14,24,15,12,(select to_number(to_char(last_day(inst_due_date),'dd')) from dual)) as ilpa_term_type
    FROM ST_IL_SCHEDULE sc,ST_IL_MASTER sm
    WHERE sc.iloan_code = sm.iloan_code
    AND sc.inst_num = (SELECT MAX(inst_num) FROM ST_IL_SCHEDULE b WHERE b.iloan_code = sc.iloan_code)
    AND sc.iloan_code =123456789)
    CONNECT BY LEVEL <= TRUNC((TRUNC(SYSDATE)-TRUNC(inst_due_date))/(ilpa_term_type) )
    Here we are using the decode concept if ilp_term_type = 26 then 14 but we need to implement the code of adding the number of days to that month in place of this code :
    select to_number(to_char(last_day(inst_due_date),'dd')) from dual:
    Please advice

  • First day of current month, one year ago

    All,
    Does anyone have a calculation or know how I can calculate the first day of the current month, one year ago? I am trying to setup a filter criteria to show all records created >= 1st day of current month for prior year and <= the last day of the prior month. I have the second half of the equation for last day prior month but need some help on the first half.
    Thanks in advance for any pointers!
    D

    You can try:
    SELECT TRUNC(ADD_MONTHS(sysdate, -12), 'MON') FROM dual;
    Or
    SELECT TRUNC(sysdate-NUMTOYMINTERVAL(1,'YEAR'), 'MON') FROM dual;

  • My ipod 4 when i plug it to my pc Windows 7 had worked fine for 8 months then one day i plug it in and a message came USB device not recognized, i tried reset network settings and nothing called apple they did not know any help out there TX

    My ipod 4 when i plug it to my pc Windows 7 had worked fine for 8 months then one day i plug it in and a message came USB device not recognized, i tried reset network settings and nothing i did not install any software before this happend i called apple they did not know, any help out there TX

    Start here:
    iPhone, iPad, or iPod touch: Device not recognized in iTunes for Windows

  • I have dial-up, and when I delete my browser history, the facebook games refuse to load for MONTHS until magically one day, they decide to open again. How can I make them load right away?

    I am using a gateway laptop, and Windows 7. I use Netzero as my dialup service, using my phone line. I deleted my browser history and cookies, but I left all passwords intact. Whenever I do this, the games on Facebook come up with a LOADING bar, but they hit 100 percent and never actually load. It does this for months, and one day, they magically (Without me changing any settings) decide to load when I click on them. How do I make the games load, and prevent this from happening every time I clear the history?

    I am using a gateway laptop, and Windows 7. I use Netzero as my dialup service, using my phone line. I deleted my browser history and cookies, but I left all passwords intact. Whenever I do this, the games on Facebook come up with a LOADING bar, but they hit 100 percent and never actually load. It does this for months, and one day, they magically (Without me changing any settings) decide to load when I click on them. How do I make the games load, and prevent this from happening every time I clear the history?

  • Strange one day adding to tasks due date (Outlook –SharePoint- MS Project integration)

    Hi,
    I have integrated MS Project 2010 with MS Outlook 2010 via SharePoint. Everything has gone more or less smoothly (as it could be for Microsoft
    J), but finally I got into a strange problem. Strangely enough,
    MS Outlook, while syncing tasks with SharePoint (these tasks are pre-created in MS Project and synced with SharePoint beforehand),
    adds one day to due dates of each of these tasks, e.g. for “Task 1” due date in MS Project and on SharePoint is 20.10.2010, but MS Outlook puts it as 21.10.2010, for “Task 2” due date in MS Project and on SharePoint is 22.10.2010, but MS Outlook
    puts it as 23.10.2010, etc.
    What is a strange trick? I have checked work time, holidays - everything is the same in MS Outlook, SharePoint and MS Project (8-17, Mon-Fri, 8 hours, 40 days a week). What could it be?
    Thanks a lot.

    Hi,
    It seems nobody can reply, so I will reply by myself because I found out the answer. The answer from Microsoft is pretty simple - ha-ha we know about,
    we will work on it, wait, ha-ha. Firstly let me quote Microsoft senior tech answer on the same request 3 month ago:
    "Hello Artur,
    The senior tech got back to me with the following conclusion:
    Outlook is rounding everything set to 12:00 PM or after to the next date because the columns mapped to start date and due dates are only Date columns,
    not date/time columns.
    It is rounding at noon because of the .5 decimal. This can be seen in Excel - 41115.5 = 7/25/2012 12:00 in date/time format whereas 41115.49 = 7/25/2012
    11:45.
    The issue seems to be an expected behavior, the next level of support is working on the same but currently I have not been provided with any ETA, so
    it looks like the issue will take a good amount of time to get fixed.
    I would appreciate your patience while we are working on the issue. I will keep you posted as and when I get an update on the issue."
    Sounds good, does not it? Ok. After asking this question recently I got run-around and finally I found the same question unsolved (see the quotation
    before) more than 3 month ago. I have sent it to Microsoft Tech Support. Look at reply I got from them on 22.10.2012:
    "This issue has been noticed and will be handled by the product team. Once we have any updates, it will be responded to you timely". 
    So the basic function does not work properly, there month passed - no way! Wait until what? I could hardly
    even imagine how Microsoft launched the product with such a bug and is not resolving the problem for months.

  • I signed up for 20 bucks a month to use photoshop and only got one day of use.  Where does that get

    I signed up for 20 bucks a month and only got one day of use of Photoshop.  Where does that get off?

    What error are you receiving?  Do you have a subscription to Photoshop CS6?

  • I have a MacBook Pro that I bought almost a year ago, next day problems with the hard disc that could not be diagnosed by the service, after 3 months they realized it and changed it with a new one, after 3-4 months heated and shut down and dont work anymo

    I have a MacBook Pro that I bought almost a year ago, next day problems with the hard disc that could not be diagnosed by the service, after 3 months they realized it and changed it with a new one, after 3-4 months heated and shut down by itself and dont work anymore. From apple say even a year has not passed it is not under garancy and I should pay to fix it without ans issue.

    I have a MacBook Pro that I bought almost a year ago, next day problems with the hard disc that could not be diagnosed by the service, after 3 months they realized it and changed it with a new one, after 3-4 months heated and shut down by itself and dont work anymore. From apple say even a year has not passed it is not under garancy and I should pay to fix it without ans issue.

  • I was using my old iPhone 4 as an iPod for 4  months when one day I got this error message saying "phone is deactivated visit your local to reactive" ... what the heck??? now the freakin thing won't even charge!!!

    I was using my old iPhone 4 as an iPod for 4  months when one day I got this error message saying "phone is deactivated visit your local to reactive" ... what the heck??? now the freakin thing won't even charge!!!

    Nope. I've already turned off cellular data. It happens regardless, as soon as it is done powering on.
    I suspect it might just be built into the phone's firmware to do that... and I have to hit "ignore" whenever it happens, but I just wanted confirmation of that...

  • How To Split One Record  into 30 Records(Number of days in a Month)

    Hi Experts,
      we are getting the montly(yearmonth) Forecast data from flat file we need to generate the report which shows the daily Forecast data,
    For example for the month of June Forecast we have  150EA.
    Flat file data is like this
      0calday    Qty
      201006     150
    we need to show the report like datawise
       Calday                                     Forecast qty
    20100601                                          5
    20100602                                          5
    20100603                                          5
    20100604                                          5
    20100605                                          5
    20100606                                          5
    20100630                                           5
    its like month forecast / Number of days in a month.
    we can achive these  in two ways as per my knowledge
    1. At the time loading data
    2. Reporting level
    Which is the best way
    how can we achive this.
    Thanks
    Chandra

    Hey.  There was a similar posting I gave a suggestion on a while back.  Here is the link...
    Re: Spliting records into cube
    As far as the correct time of doing this, I would definitely do this at the time of data load and not time of reporting. 
    Hope you find it helpful.
    Thanks

  • Error #2046  -  Site Worked fine for months.. then one day CAPUT!?

    Can someone tell me what happened? I spent lots of time making a nice site using the Flash Catalyst Beta.... then one day it stopped working now I just get this error...
    w.w.w_.innodnc._c.0.m
    what can I do to fix it? How did it break without any changes whatsoever? Is it just a new version of flash causing problems?
    HELP! I need this site up ASAP!

    Hi,
    What version of Fc are you using?  Is your date and time on your computer correct?
    Take a look at this thread and bugs listed in the Flash Builder forums.
    http://forums.adobe.com/thread/620441
    http://bugs.adobe.com/jira/browse/SDK-15282
    http://bugs.adobe.com/jira/browse/SDK-28016
    Best,
    Tanya

Maybe you are looking for