SQL to display start, end date, days in each month between 2 dates

HI all,
Please hep since I'm so new on this. I have a date range 01/15/2012 to 11/26/2012. What I have to do is to display it like below:
01/15/2012, 01/31/2012, 16 days
02/01/2012, 02/29/2012, 29 days
03/01/2012, 03/31/2012, 31 days
11/01/2012, 11/26/2012, 26 days.
Thanks for helping me.

Hi Harvey,
Try this....
SELECT TO_DATE ('15-JAN-2012') start_date,
       LAST_DAY ((TO_DATE ('15-JAN-2012')))
             end_date,
       (LAST_DAY ((TO_DATE ('15-JAN-2012'))) - TO_DATE ('15-JAN-2012')) no_of_days
  FROM DUAL
UNION
SELECT start_date, end_date, no_of_days
  FROM (SELECT     (TO_DATE ('15-JAN-2012') + LEVEL) start_date,
                   LAST_DAY ((TO_DATE ('15-JAN-2012')) + LEVEL)
                         end_date,
                   (  LAST_DAY ((TO_DATE ('15-JAN-2012')) + LEVEL)
                    + 1
                    - (TO_DATE ('15-JAN-2012') + LEVEL)
                   ) no_of_days
              FROM DUAL
        CONNECT BY LEVEL <= (TO_DATE ('26-NOV-2012') - TO_DATE ('15-JAN-2012')))
WHERE (   TO_CHAR (start_date, 'DD') = '01'
        OR start_date = TO_DATE ('15-JAN-2012')
        OR start_date = TO_DATE ('26-NOV-2012')
   AND start_date < TRUNC (TO_DATE ('26-NOV-2012'), 'MON')
UNION
SELECT TRUNC (TO_DATE ('26-NOV-2012'), 'MON') start_date,
       TO_DATE ('26-NOV-2012')
             end_date,
       (TO_DATE ('26-NOV-2012') + 1 - TRUNC (TO_DATE ('26-NOV-2012'), 'MON')) no_of_days
  FROM DUAL;
I Have hot coded the dates.. You can use parameters as start date and date
Hope it will work.
Regards,
Soofi

Similar Messages

  • How do I find the start day of each month

    Hi all,
    Hope someone can give a a hand here I've to do a calender project for college and I'm not allowed to use any built in Java classes so fun all the way so far :-)
    I've got one question that is bugging me at the moment. and that is how to find the start day for each month in a year and store them in an array.
    I'm starting my week at Monday (0) and stopping at Sunday (6) and I do have a formula for discovering the first day in Jan of the given year its
    ((y-1900)*365 + (y-1901)/4)%7
    I was just wondering how I could amend this to find the first day in Feb, March etc.
    Any suggestions greatly accepted.
    Thanks in advance.

    Irish-Student wrote:
    newark maybe I didnt make clear exactly what I want to do.
    I have each day of the week starting at 0 for Monday up to 6 for Sunday I want to map what the start day of a month as a number between 0 and 6.
    The formula I have discovering the first day of Jan of a given year will give you 1 i.e. Tuesday
    what I need to do is find out what number between 0 and 6 the start day of each other month of a given year is.
    For example the 1st of Feb is a Friday which is 4 on the weekday map.
    Your suggestion of 31%7 won't work for this, sorry more than likely my fault for not being clearer in what my requirements were.
    Cheers for the help so far and yep your right not being able to use the built in classes is a pain :-)
    Edited by: Irish-Student on 03-Mar-2008 20:01This doesn't really change much of my first suggestion. If you can already calculate the first day of the month of January for any given year, then there's no problem figuring out the other months. Say I want to know the first day April 1, 1978. You already know how to find January 1, 1978. So find that. Then find the number of days between January 1 and April 1 (remember to account for leap years). Once you have the number of days, you can figure out how many weeks and days that is, and thus what day of the week it is.

  • 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

  • Creating new report 1st day of each month

    Hello, all!
    I have a vi that I run to record pressure on test units.  I want to create a new excel report on the 1st day of each month.  If it is not the 1st day of the month I want to just add the data for each test unit as a new worksheet.  I have looked around and can't find a post for what I need to do exactly.  If anyone can help, greatly appreciate.

    Hey END82,
    I agree with RTSLVU's suggestion of using the Seconds to Date/Time vi. From there you can wire the day of the month into a case structure, and have the case for day number 1 to be where you create a new excel report and have the other default case add the data to the report. 
    I attached a VI Snippet which you can drag onto a block diagram to look at.
    Hope this helps!
    Joe S
    Applications Engineer
    National Instruments
    Attachments:
    date.png ‏13 KB

  • How can I set an event to repeat on a week day rather than a numerical day of each month?

    How can I set an event to repeat on a week day rather than a numerical day of each month? I see an option at the bottom of the repeat window .... but I cannot use it. Actually, when I try it freezes up my Calendar.
    Lorrene Baum Davis

    These scrrenshots are from Snow Leopard - I would think that Lion wouldn't be too much different.

  • Define event to repeat on the last day of each month?

    (I've searched the forum and can't find this question addressed)
    I want to create a repeating event for the last day of each month. Is this possible?

    Unfortunately Apple does not have an option available that allows you to add an event repeating on the last day of the month. An "OK" way around this would be to repeat on the 1st of every month and send a reminder a day earlier. I know this is less then perfect but the only option currently available. If you happen to find a 3rd party program that allows such integration please don't hesitate to mention it here as I have been looking for this sort of option for quite some time now!

  • How many dates are in each month?

    Is there an easy way to determine how many dates are in each
    month?
    as of right now I am looping through creating a new Date()
    and when the month changes I know the last date of the month.
    This is kind of slow, and building a switch statement would
    be kind of exhaustive.
    Any ideas?

    This method is created from the same named method in
    mx.controls.CalendarLayout:
    private function getNumberOfDaysInMonth(year:int,
    month:int):int{
    var n:int;
    if (month == 1) {
    if (((year % 4 == 0) && (year % 100 != 0)) || (year
    % 400 == 0))
    n = 29;
    else
    n = 28;
    else if (month == 3 || month == 5 || month == 8 || month ==
    10)
    n = 30;
    else
    n = 31;
    return n;

  • Last day of each month in a year based on a Input date?

    Hi all,
    I have a request from a customer who wants to have a yearly report created in BEx Query Designer which starts in January up to December and they want to have a Month To Date (MDT) and Year to Date (YTD) calculation of a key figure. This report will only show one year at the time based on the date the user give as input at the Variable Screen.
    This key figure should be calculated by using the last date of each month for input when performing the MTD and YTD calculation and summarizations.
    Example:
    January: 31.01.2008  Key Figure = 1000. MTD = 1000 and YTD = 1000
    February: 29.02.2008  Key Figure = 2500. MTD = (2500-1000) 1500 and YTD = 2500
    March: 31.03.2008  Key Figure = 6000. MTD =(6000-2500)=3500 and YTD = 6000
    Etcu2026.
    This means that I have to have a lot of hidden Key figures which gets restricted on the different month end dates and formulas to calculate the different MTD and YTD results for the months as the year progresses.
    The way I have solved it now is that I have a Customer Exit which gives me the Last day of last year (Exp: 31.12.2007) based on input date and use a Offset on the last day of last year date to get the different last dates of each month.
    Since we have a leap year (one extra day in February) this year, the offset to calculate the end month dates will be different for 2007 and next year (2009). This solution is not very flexible, and it will not give the correct MTD and YTD if the customer wants to go back to 2007 and off course next year (2009).
    One solution is to create 12 Customer Exits that gives me the different month end dates (January-December), and also takes in account leap year for February for the different years. These Exits will be based on the Input date the Customers put in at the variable screen.
    I would rather want to avoid making 12 new customer exits and want your advice and expertise to find out if this is possible in any other way (maybe with only 1 customer exit) to get the last date of each month based on an input date.
    Thanks for all your advices on beforehand.
    Regards
    Oddmar Lid

    Hi,
    Thanks for you replay and documentation, but it doesn't give me excatly the functionality I'm after. The only MTD calculation code the document provides is the calculation of the following functionality:
    "Month to Date (MTD) u2013 From the 1st of month to u201CKey Dateu201D - for current year." This doesn't give the the functionality I want, which is to retrieve a given vaule for a Key Figure for the last dates of the months in a year to calculate MTD and YTD.
    This way I have created the query is to have multiple hidden Key Figures that calculates the MTD and YTD.
    In Columns in Query Designer it will look something like this:
    Selection: MTD January--> Date = 31.01.2008, Key Figure (Always Show)
    Selection: YTD January --> Date= 31.01.2008, Key Figure (Always Show)
    Selection: MTD February --> Date= 29.02.2008, Key Figure (Always Hide)
    Formula: MTD February --> MTD February - MTD January (Always Show)
    Selection YTD February --> Date = 29.02.2008, Key Figure (Always Show)
    And so on....
    This is off course a simplified version, but it shows the core of the solution. What I want to achive here is that the dates used to get the Key Figures (last date of a month) is calculated as flexible as possible, so that the users can go back and forth in time without worrying about the leap year problem and so on. I have now used an offset from the last date of last year and this is good for all the normal years, but when it is a leap year the query will use wrong dates to get the key figure vaule for the last date of each month.
    Any ideas on how to achieve this without creating 12 different Customer Exit variables (one for each end date of each month)?
    Thanks
    Regards
    Oddmar Lid

  • Last day of previous month for data load

    Hi,
    I have to load data from the previous month into the psa and then into an infocube. I was wondering as to how to get the last of the previous month to write a code in ABAP. I will be writing the code at the infopackage level in the data selection. I could load data from the 1st of the previous month to the 1st of the current month. This will be an additional load of 30,000 records for the 1st of every month, since I will be loading 30,000 records everyday, I was wondering if I could limit the load from the 1st of every previous month to the last day of that month. This will be a repetitive loading.
    DATA: CURR_MM(2) TYPE N,
    CURR_YYYY(4) TYPE N,
    CURR_DD(2) TYPE N,
    PREV_MM(2) TYPE N,
    PREV_YYYY(4) TYPE N,
    PREV_DD(2) TYPE N,
    YYYY_MM(6),
    YYYY_MM1(6),
    DATE LIKE SY-DATUM.
    DATE = SY-DATUM.
    CURR_YYYY = DATE+0(4).
    CURR_MM = DATE+4(2).
    CURR_DD = DATE+6(2).
    PREV_DD = 1.
    IF CURR_MM = '01'.
    PREV_MM = '12'.
    PREV_YYYY = CURR_YYYY - 1.
    ELSE.
    PREV_MM = CURR_MM - 1.
    PREV_YYYY = CURR_YYYY.
    ENDIF.
    concatenate PREV_YYYY PREV_MM PREV_DD into YYYY_MM.
    concatenate CURR_YYYY PREV_MM PREV_DD into YYYY_MM1.
    read table l_t_range with key
    fieldname = 'BLDAT'.
    l_idx = sy-tabix.
    l_t_range-low = YYYY_MM.
    l_t_range-high = YYYY_MM1.
    l_t_range-sign = 'I'.
    l_t_range-option = 'BT'.
    modify l_t_range index l_idx.
    p_subrc = 0.
    Mind you this code will load data from 1st of the previous month to the 1st of current month. I just don't want to load that extra "1st day" of current month data as I have 30,000 records everyday.
    Say for example, I want to load data from 1st Mar to 31st Mar or 1st Feb to 28thFeb. How should I modify the above code.
    Is there a formula to get the last date of the previous month. That's all I need. This would solve the problem.

    try this routine. it will return a range from 1st day to end of the month.
    DATA: l_s_range TYPE rsr_s_rangesid,
              E_T_RANGE TYPE  RSR_T_RANGESID.
    DATA: year(4) TYPE n,
          month(2) TYPE n,
          day(2) TYPE n,
        ld_keydate  TYPE sydatum,
          ld_lastday  TYPE sydatum.
      REFRESH e_t_range.
      CLEAR l_s_range.
      year  = sy-datum(4).
      month = sy-datum+4(2).
    *Months with 31 days in year
      IF month = '01' OR
         month = '03' OR
         month = '05' OR
         month = '07' OR
         month = '08' OR
         month = '10' OR
         month ='12'.
        day = '31'.
      ENDIF.
    *check for leap year: provoking sy-sybrc <> 0
      IF month = '02'.
        day = '29'.
        MOVE:   '02'        TO ld_keydate+4(2),
                year        TO ld_keydate(4),
                day         TO ld_keydate+6(2).
        CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
          EXPORTING
            date   = ld_keydate
          EXCEPTIONS
            OTHERS = 1.
        IF sy-subrc <> 0.
          day = '28'.
        ENDIF.
      ENDIF.
    *months with 31 days in year
      IF month = '04' OR
         month = '06' OR
         month = '09' OR
         month = '11'.
        day = '30'.
      ENDIF.
      MOVE: year              TO ld_lastday(4),
            month             TO ld_lastday+4(2),
            day               TO ld_lastday+6(2).
      l_s_range-low  = sy-datum.
      l_s_range-high = ld_lastday.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'BT'.
      APPEND l_s_range TO e_t_range.

  • How to apply Date condition for each month in 12 month period to my SQL query

    I am trying to retrieve all Outstanding Problem tickets in my Trendline SSRS report.
    I need to pull the OpenDate <= Last day of last month And CloseDate >= 1st day of current month
    for each month in the Last 12 months. How do I accomplish this in my query?
    I must also need to pull the oustanding tickets for the next 11 months in the same query
    where it will automatically pull the outstanding tickets for when a new month comes
    in out of the 12 month period?
    Here's a sample of my query to pull July 2013 Outstanding Problem tickets:
    Select OpenDate, CloseDate, Ref_Num, Type, status
    From Call_Req
    Where OpenDate <= '2013-07-31 00:00:00' And CloseDate >= '2013-08-01 00:00:00'
    And Type = 'P'
    My Results:
    OpenDate
    CloseDate
    Ref_Num
    Type
    status
    6/13/2013 7:41
    8/26/2013 12:41
    P1726456FY13
    P
    CL
    6/13/2013 8:17
    8/23/2013 12:31
    P1726612FY13
    P
    CL
    6/13/2013 10:17
    9/6/2013 16:54
    P1727352FY13
    P
    CL
    7/12/2013 10:46
    9/6/2013 10:23
    P1812568FY13
    P
    CL
    7/18/2013 10:17
    9/6/2013 8:53
    P1830452FY13
    P
    CL
    7/29/2013 15:54
    9/6/2013 16:16
    P1862906FY13
    P
    CL
    5/17/2013 20:51
    8/22/2013 9:09
    P1653380FY13
    P
    CL
    5/30/2013 13:29
    8/26/2013 7:33
    P1685693FY13
    P
    CL
    7/15/2013 14:14
    9/7/2013 9:42
    P1818874FY13
    P
    CL
    6/7/2013 15:49
    9/6/2013 16:46
    P1712265FY13
    P
    CL
    7/18/2013 10:25
    9/7/2013 9:18
    P1830516FY13
    P
    CL
    7/24/2013 16:30
    8/12/2013 18:26
    P1849909FY13
    P
    CL
    Talitha Davis

    Would this Work?
    DECLARE @now DATE = GETDATE();
    WITH months(lvl, daydate)
    AS (
    SELECT
    1,
    @now
    UNION ALL
    SELECT
    lvl + 1,
    DATEADD(MONTH, -1, daydate)
    FROM months
    WHERE lvl < 12
    ), dateranges(period, opendate, closedate)
    AS (
    SELECT
    CAST(YEAR(daydate) AS CHAR(4))
    + '-'
    + RIGHT('0' + CAST(MONTH(daydate) AS varCHAR(2)), 2),
    DATEADD(DAY, 0-DAY(daydate), daydate),
    DATEADD(DAY, 1-DAY(daydate), daydate)
    FROM months
    SELECT
    b.period,
    a.OpenDate,
    a.CloseDate,
    a.Ref_Num,
    a.Type,
    a.status
    From Call_Req a
    INNER JOIN dateranges b
    ON
    a.OpenDate <= b.opendate
    AND
    a.CloseDate >= b.closedate
    WHERE Type = 'P';
    Microsoft Certified Trainer & MVP on SQL Server
    Please "Propose as Answer" if you got an answer on your question, and vote for it as helpful to help other user's find a solution on a similar question quicker.

  • How to get the Day of the Month and Date on Home Screen

    The home screen has the signal strength on the upper left, the time in the middle and the battery status on the right. What is missing from my old phone (really, really old phone) is the day - like Sunday, and the date - like the 20th. I have to go to a calendar program to get what should be available at a glance, just like the time.
    Can this be done?
    aehaas

    If you put the Apple calendar app on the first screen, it shows the day and date (no month/year). E.g Sunday 20.

  • Amount of days in each month

    Post Author: mike7510uk
    CA Forum: Formula
    i have a report where i have the days of the month along the top. I use this formula to get the day number
    ... int(day(DateAdd ("D",0,cdate({Command_1.startdate} )))) ...
    where the 0 is incremented along the report up to 30. The startdate bit of the formula is a pre-defined date such as 01-04-2007 (1st april)
    The fields then all work up to the point of 30th, i need it to end there and not go into the next month (1st)
    Obviously this is fine if the month has 31 days as it will just display 1-31. I need some IF statements maybe that looks at which month is selected and displays the correct amount of days.
    Any ideas?

    Post Author: SKodidine
    CA Forum: Formula
    The easiest way to get the last day of the month (and hence the number of days in a month) is to use the custom function that comes with CR.  I have only worked with CR XI so not sure about other versions.
    1. Open the formula workshop.
    2. From the Repository Custom Functions, under Crystal and then Date, RIGHT click on cdlastdayofmonth, click on ADD TO REPORT.
    3. Create a new formula, in the formula workshop, under FUNCTIONS, go down the list till you see "CUSTOM FUNCTIONS", expand that till you see cdlastdayofmonth.
    4.  In your formula, type cdlastdayofmonth(currentdate)
    5. Save and close and display the formula in your report, you should see 04/26/2007, depending on your date format.
    You can customize the formula to suit your needs, and this way you do not have to worry about leap years..

  • How to create appointment occurs last day of each month

    Hi Preston,
    I am trying to create a monthly recurring appointment occurs on last day of every month in .Net. E.g. start at May 31, 2010 end at May 31 2011 every month.
    I specified the frequency as monthly, byMonthDay[0] = (sbyte)31. But this only generates the instances on those months contain the 31th day. My question is how to also create instances on 30th day for those months don't contain the 31th day.
    Thanks,
    John

    The recurrence rule logic is patterned after the recurrence
    logic in iCalendar (http://www.ietf.org/rfc/rfc2445.txt)
    If you have questions, first look there. Then look at the
    schema itself.
    In the schema the definition of DayOfMonth will handle
    negative numbers:
    <xs:simpleType name="DayOfMonth">
    <xs:restriction base="xs:byte">
    <xs:minInclusive value="-31"/>
    <xs:maxInclusive value="31"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="DayOfMonthList">
    <xs:sequence>
    <xs:element name="day" type="tns:DayOfMonth" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    So, the last day of the month would be -1. The second
    to last day would be -2 and so on.
    >>> On Wednesday, May 26, 2010 at 11:56 AM, Johnny
    77<[email protected]> wrote:
    > Hi Preston,
    >
    > I am trying to create a monthly recurring appointment occurs on last
    > day of every month in .Net. E.g. start at May 31, 2010 end at May 31
    > 2011 every month.
    >
    > I specified the frequency as monthly, byMonthDay[0] = (sbyte)31. But
    > this only generates the instances on those months contain the 31th day.
    > My question is how to also create instances on 30th day for those months
    > don't contain the 31th day.
    >
    > Thanks,
    > John

  • Months between Dates

    Hi All,
    How do i get the number of months between 2 dates ?
    I have the 2 dates stored as
    Date EffctFrmDt = voRow.getEffectiveFromDate();
    Date EffctToDt = voRow.getEffectiveToDate();
    The values printed for EffctFrmDt & EffctToDt are 2008-06-11 & 2008-10-31
    I'm trying to print the months
    System.out.println("Date diff : " + EffctFrmDt.diffInMonths(EffctToDt));
    I get the following Error stack
    oracle.apps.fnd.framework.OAException: oracle.jbo.domain.GenericDomainException: JBO-25023: Error while performing operation:Date.diffInMonths on domain value:2008-06-11 of class:oracle.jbo.domain.Date.
    at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
    at OA.jspService(_OA.java:71)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.sql.SQLException: Unimplemented method called
    at oracle.sql.LdxLibThin.ldxsbm(LdxLibThin.java:1402)
    at oracle.sql.DATE.diffInMonths(DATE.java:918)
    at oracle.jbo.domain.Date.diffInMonths(Date.java:507)
    at agi.oracle.apps.cn.quota.webui.CustomSnltyCreatePgCO.processFormRequest(CustomSnltyCreatePgCO.java:281)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
    at OA.jspService(_OA.java:71)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    java.sql.SQLException: Unimplemented method called
    at oracle.sql.LdxLibThin.ldxsbm(LdxLibThin.java:1402)
    at oracle.sql.DATE.diffInMonths(DATE.java:918)
    at oracle.jbo.domain.Date.diffInMonths(Date.java:507)
    at agi.oracle.apps.cn.quota.webui.CustomSnltyCreatePgCO.processFormRequest(CustomSnltyCreatePgCO.java:281)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
    at OA.jspService(_OA.java:71)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    Am I doing anything wrong or is there some other approach to this ??
    Thanks and Regards,
    Dean

    There can be two possible approcahes:
    JAVA
    Use calendar class, its pretty straight forward.
    sql
    SELECT MONTHS_BETWEEN('01-JAN-01','01-AUG-01') AS MONTHS_BETWEEN FROM Dual;
    Please do a google before basic threads for core java.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to display the all the days in the month

    Hi,
    How to display with the single sql stmt all the dates in a
    month.
    Like :
    1, 2, 3, 4....last_day month
    or
    1
    2
    3
    4
    ...last_day of month

    SQL> CREATE OR REPLACE FUNCTION all_days(v_date DATE)
      2  RETURN VARCHAR2 AS
      3 
      4   v_last_day NUMBER := TO_CHAR(LAST_DAY(v_date), 'DD');
      5   v_all_days VARCHAR2(1000);
      6  
      7  BEGIN
      8 
      9     FOR i IN 1..v_last_day
    10     LOOP
    11     
    12        v_all_days := v_all_days || ' ' || i;
    13 
    14        IF INSTR(v_all_days, v_last_day) > 0
    15        THEN
    16      RETURN v_all_days;
    17        END IF;
    18     END LOOP;
    19  END;
    20  /
    Function created.
    SQL> select all_days(sysdate)
      2  from dual
      3  /
    ALL_DAYS(SYSDATE)
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    25 26 27 28 29 30 31
    SQL> select all_days('01-feb-2002')
       2  from dual
       3  /
    ALL_DAYS('01-FEB-2002')
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    25 26 27 28
    SQL> select all_days('01-feb-2004') --Next Leap Year
       2  from dual
       3  /
    ALL_DAYS('01-FEB-2004')
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    25 26 27 28 29

Maybe you are looking for

  • Is it possible to have 2 different Ipods on one computer?

    I have a Ipod mini first generation and just got a new 30G Ipod. I downloaded all my music on to the new Ipod and when to Clean out the old one to download music for my mom on it. After I was done downloading the old Ipod with my mom music I went to

  • Windows 7 Professional downgrade from Windows 8.1 Pro OEM

    Hi, I purchased new computers for a small business with Windows 8.1 Pro OEM licenses and disks. I was intending to install windows 7 Pro using downgrade rights but when I enter the product key that came with Windows 8.1 it gives me an error with "Inv

  • Please Help: I could not save my Premiere CC and now Premiere won't open!

    I've been working on this project (on a Mac)  for several weeks without any problems Today I rendered my sequence. I also deleted some files from my computer while it was rendering to make extra space. First I got this message: You do not have write

  • SortedSet

    Hello. I need some help. I have to store some data (type : object) in sortedset, but I have no idea on how to implement it. In my object, it has a parameter unique ID in type double. and I would like it sorted based on this unique ID. Could anyone te

  • Why is Adobe Digital Editions unable to download an ebook from my local library?

    Adobe Digital Editions will not let me download an ebook from my local library.  Have done this many times in the past but now it won't let me.  Why?