Subtracting days from a Date

Am using Acrobat 9 Pro for Windows.  I have a form where I want to subtract days from Date1 and Date2 results.  The Date1 and Date 2 text boxes are not formatted.  I tried reading the articles of 'date' and experimental with formulas but I'm afraid that I am still illiterate Acrobat.  Any ideas?  Thank you.

It would be better if you set the Date1 field to be formatted as a date. In this way, Acrobat uses a built-in routine to validate automatically the entry represents a valid date. You can then use a calculation script custom of the field Date2 that looks like:

// Custom Calculate script for text field
(function () {

    // Get Date1 field value
    var v = getField("Date1").value;

    // If field is empty, blank this field
    if (v === "") {
        event.value = v;
        return;
    }

    // Convert the date string to a date object
    var d = util.scand("mm/dd/yyyy", v);

    // Subtract 5 days
    d.setDate(d.getDate() - 5);

    // Set this field's value
    event.value = util.printd("mm/dd/yyyy", d);

})();

Change the format of date (mm/dd/yyyy) in the code above to match what you want to use.

Tags: Acrobat

Similar Questions

  • get more records of 30 days from the date of the day

    I use MS SQL 2000 How can I recover the data that are older than 30 days from the date of the day? I put currendate "DateTime" field as data type and length is the '8 '.

    < cfset variables.getdate = DateAdd (would be ',-30, now()) >

    Select dataname
    of tabletest
    where currendate > = "variables.getdate."

    the sql stmt above does not work.

    Select dataname
    of tabletest
    where currendate<= #createodbcdate(dateadd("d",="" -30,="">

    You say that you want records which are more than 30 days from now, so that it must be less than or equal to the date
    But if you want the Chronogram of 30 days there are until now then it must be greater than or equal to

    Ken

  • common to the appellants for 3 days from particular date

    Need to find the number of other_party which is a common call for conseutive 3 days

    Create table call (key id Number (15) not null, mobile_number number primary (10), other_party number (10), call_type varchar2 (10), the call_date_time date, number (15)) duration;


    insert into values of the call (1,9818764535,9899875643, 'IN', to_date (24 May 12 02:10:43 "," dd-MON-yy hh24:mi:ss'), 10);
    Insert in appeal values (2, 9818764535,9215478213, 'OUT', to_date (24 May 12 08:11:13 "," dd-MON-yy hh24:mi:ss'), 20);
    Insert in appeal values (3, 9818764535,9899875643, 'IN', to_date (25 May 12 18:07:02 "," dd-MON-yy hh24:mi:ss'), 30);
    insert into values of the call (4,9818764535,9012451785, 'IN', to_date (26 May 12 02:11:13 "," dd-MON-yy hh24:mi:ss'), 40);
    Insert in appeal values (5, 9818764535,9215478213, 'IN', to_date (26 May 12 08:17:02 "," dd-MON-yy hh24:mi:ss'), 25);
    Insert in appeal values (6, 9818764535,9899875643, 'OUT', to_date (26 May 12 20:21:04 ',' dd-MON-yy hh24:mi:ss'), 67);


    Entry criteria:

    Mobile phone number: 9818764535
    date: 24 April 13

    Output:


    Other_party call_type time call_date_time
    9899875643 IN 24 APRIL 13 02:10:43 10
    9899875643 ON APRIL 25, 13 18:07:02 30
    9899875643 ON 26 MAY 13 20:21:04 67

    Published by: 983567 on May 2, 2013 03:51

    Published by: 983567 on May 2, 2013 03:52

    Hello

    983567 wrote:
    Need to find the number of other_party which is a common call for conseutive 3 days

    Create table call (key id Number (15) not null, mobile_number number primary (10), other_party number (10), call_type varchar2 (10), the call_date_time date, number (15)) duration;

    insert into values of the call (1,9818764535,9899875643, 'IN', to_date (24 April 13 02:10:43 "," dd-MON-yy hh24:mi:ss'), 10);
    Insert in appeal values (2, 9818764535,9215478213, 'OUT', to_date (24 April 13 08:11:13 "," dd-MON-yy hh24:mi:ss'), 20);
    Insert in appeal values (3, 9818764535,9899875643, 'IN', to_date (25 April 13 18:07:02 "," dd-MON-yy hh24:mi:ss'), 30);
    insert into values of the call (4,9818764535,9012451785, 'IN', to_date (26 May 13 02:11:13 "," dd-MON-yy hh24:mi:ss'), 40);
    Insert in appeal values (5, 9818764535,9215478213, 'IN', to_date (26 May 13 08:17:02 "," dd-MON-yy hh24:mi:ss'), 25);
    Insert in appeal values (6, 9818764535,9899875643, 'OUT', to_date (26 May 13 20:21:04 ',' dd-MON-yy hh24:mi:ss'), 67);

    AE there no set of 3 days of consctuive in the sample data.
    Did you mean to say "APR" everywhere, you said 'MAY' above?

    Entry criteria:

    Mobile phone number: 9818764535
    date: 24 April 13

    Output:

    Other_party call_type time call_date_time
    9899875643 IN 24 APRIL 13 02:10:43 10
    9899875643 ON APRIL 25, 13 18:07:02 30
    9899875643 ON 26 MAY 13 20:21:04 67

    Here's one way:

    WITH     params     AS
    (
         SELECT  9818764535          AS mobile_number
         ,     DATE '2013-04-24'     AS start_date
         FROM     dual
    )
    ,     got_cnt          AS
    (
         SELECT     c.*
         ,     COUNT (DISTINCT TRUNC (c.call_date_time))
                  OVER ( PARTITION BY  p.mobile_number
                          ,                p.start_date
                      ,           c.other_party
                    )     AS cnt
         FROM     params     p
         JOIN     call     c  ON   c.mobile_number  = p.mobile_number
                      AND     c.call_date_time >= p.start_date
                      AND     c.call_date_time <  p.start_date + 4
    )
    SELECT     *     -- or list columns wanted
    FROM     got_cnt
    WHERE     cnt     = 3
    ;
    

    You can search for 2 or more distinct (mobile_number, start_date) target in the same query, if you wish.
    It is easy to make consecutive (3) the number of days in this case a parameter.

  • find the days from the date of...

    Hi all

    I have a date saying (06-mar-2009), then how do you know what day is the same day as today (Friday)... and I need to create a table based on another table and must include all dates it's Saturday...

    If someone can help me...

    Thank you
    Pankaj

    If you are looking for the week then->

    CREATE TABLE test
    AS
      SELECT *
      FROM emp
      where to_char(hiredate,'DY') NOT IN ('SAT','SUN');
    

    Another thing,

    CREATE TABLE test
    AS
      SELECT *
      FROM emp
      where to_char(hiredate,'DY') IN ('SAT','SUN');
    

    Alternatively,.

    Please post your desired output of your sample data.

    Kind regards.

    LOULOU.

  • Select the event to add (or subtract) per day for a date field

    I have a form that gives me a little trouble. I want to be able to enter a start date in a field, and then enter a number of days in another field and then have it calculate a date that is the number of days from the start date. The form is actually work very well most of the time, but there are a few problems I encounter.

    1 end date does not immediately calculate out the number of days. You need to tab all the way back to the start and date only when you leave that field does calculate the end date I need to calculate when you leave the number of days.

    2. I added a small (+) and (-) button to increase or decrease the date by one day. It works, but the problem is, I want to do it in the background. Which means, I want the calculated date to change, but the number of days field not change.

    Tell me if I go on 01/12/2010 to the start date. Then I go 1 in the # of days field. When I tab to the calculated date field, it must immediately change to 02/12/2010. So, if I click on the (+), the date calculated field should go up to 03/12/2010, but the number of days field should stay at 1.

    I downloaded a sample of what I've understood so far:

    https://Acrobat.com/#d=v4c4KKdj0hesicxO8yO1pw

    Thanks a lot for any help I can get on it!

    JO

    I think that's what you're after. I moved the logic to calculate the date event deadline and added a numeric field to store the result of the addition/subtraction (called 'delta').

    Form1. #subform [0]. date2::calculate - (FormCalc, client)

    var date1 = Date2Num(date1.formattedValue,"MM/DD/YYYY")

    $.rawValue = Num2Date(date1+days+delta,"MM/DD/YYYY")

    You could do 'delta' hidden.

    Steve

  • How can I move photos from one date to another in my catalog? Downloaded LR of photos taken over several days to a date. LR6 PC Win7

    How can I move photos from one date to another in my catalog? Downloaded LR of photos taken over several days to a date. LR6 Win7 PC.

    Hi bubba43,

    Please select the images in the library grid mode Module and then drag and drop them in another folder you want.

    Kind regards

    Tanuj

  • 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

  • To find the months and days between 2 dates

    Hello

    I want to find the months and days between 2 dates.

    For example.

    1 - Date: August 25, 2013

    2 - Date: October 23, 2013

    If we consider each month 30 days, it should give

    August 25, 2013 to August 30, 2013 = 6 days

    01-Sep-2013-30-Sep-2013 = 1 month

    October 23, 2013 to October 30, 2013 = 8 days

    Total = 1 month and 14 days.

    Kindly help as soon as possible.

    Thanks and greetings

    Suresh

    Assuming that d2 > d1,.

    where d)

    Select sysdate d1, sysdate + 56 double d2

    Union all select to_date (March 1, 2013 ',' dd-mon-yyyy "") d1, to_date (March 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (5 February 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (February 25, 2013 ',' dd-mon-yyyy "") d1, to_date (March 23, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (February 25, 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (August 2, 2013 ',' dd-mon-yyyy "") d1, to_date (29 October 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (February 1, 2013 ',' dd-mon-yyyy "") d1, to_date (May 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (25 August 2013 ',' dd-mon-yyyy "") d1, to_date ('03-Sep-2013', 'Mon-dd-yyyy') d2 double

    Union all select to_date (July 30, 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (August 30, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (3 August 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (3 July 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date ('31-08-2013', ' dd-mm-yyyy'), to_date('05-10-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('31-03-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-03-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-02-2013','dd-mm-yyyy') of the double

    )

    Select d1, d2,

    1 + 30 * trunc (months_between (d2, d1)) + LESS (extract (day of d2), 30)-LESS (excerpt (d1 day), 30)

    + CASE when extracted (d2 day)< extract(day="" from="" d1)="" then="" 30="" else="" 0="" end ="">

    d

    D1 D2 DAYSBETWEEN

    ----------- ----------- -----------

    October 10, 2013 5 December 2013 56

    March 1, 2013 30 March 31, 2013

    5 February 2013 March 31, 2013 56

    February 25, 2013 March 23, 2013 29

    February 25, 2013 March 31, 2013 36

    August 2, 2013 29 October 2013 88

    February 1, 2013 may 31, 2013 120

    August 25, 2013 03 - Sep-2013 9

    July 30, 2013 31 August 31, 2013

    July 31, 2013 August 30, 2013 31

    July 31, 2013 3 August 2013 4

    July 3, 2013 August 31, 2013 58

    31 August 2013 5 October 2013 36

    5 February 2013 March 31, 2013 56

    5 February 2013 March 5, 2013 31

    February 5, 2013 February 5, 2013 1

    In my view, which corresponds to your rules.

  • JavaScript anomaly on the number of days between two dates

    Use ApEx 4.0, I found an anomaly in a javascript code that calculates the number of days between two dates, the current_date and the past_date. If the past and present is the or before March 10, 2013, and the current_date lies between 10 March 2013 and November 3, 2013, the number of days will be from 1 day to less than the actual number. Between November 3, 2013 and on 4 November 2013, the increments of number by 2, then the count will be accurate from this date forward.

    Here are some examples:

    March 10, 2013 = 69 days of December 31, 2012
    March 11, 2013 = 69 days of December 31, 2012
    March 12, 2013 = 70 days of December 31, 2012

    November 3, 2013 = 306 days in December 31, 2012
    November 4, 2013 = 308 days in December 31, 2012

    11 March should be 70 and 12 March should be 71. November 3 is 307 and 4 November corrects the number of fake, which began March 11.

    Change the past_date to March 10, 2013 produces the following:

    March 10, 2013 = 0 days of March 10, 2013
    March 11, 2013 = 0 days of March 10, 2013
    March 12, 2013 = 1 days of March 10, 2013

    But change the past_date to 11 March 2013, product of the correct numbers:

    March 11, 2013 = 0 days of March 11, 2013
    March 12, 2013 = 1 days of March 11, 2013
    March 13, 2013 = 2 days of March 11, 2013

    I would certainly all help to determine the cause of this anomaly. Here's the javascript code:

    var w1 = ($v ("P48_PAST_DATE"));
    W1 = (w1.toString ());
    vmon var = (w1.substr (3.3));
    vyr var = (w1.substr (7));
    var r = (vyr.length);
    If (r == 2)
    vyr. = (parseFloat (vyr) + 2000);
    vday var = (w1.substr (0.2));
    var y = (vmon.concat ("", vday, ",", vyr));
    y = Date.parse (y);

    var w2 = ($v ("P48_CURRENT_DATE"));
    var vmon2 = (w2.substr (3.3));
    var vyr2 = (w2.substr (7));
    var vday2 = (w2.substr (0.2));
    var x = (vmon2.concat ("", vday2, ",", vyr2));
    x = Date.parse (x);

    var numdays = (x - y);
    numdays = (Math.floor(numdays / 86400000));
    $s ("P48_NUMBEROFDAYS", numdays);

    Did you google for something like "javascript number of days between two dates. I think you will find the explanation to this observation:

    This method does not work correctly if there is an advanced economies jump between the two dates.

    There are examples available to calculate the difference between two dates.

  • Disable certain days in the date picker

    Hi, I use Apex 4.2 and want to find a way to disable certain days in the date picker.

    For Ex: I want to turn off Mondays and the days of the week when the date picker popup is shown. And also I want all the previous days from today should be disabled.

    Please let me know how I can do this...

    Thank you

    Hello

    to disable different days look at this site: http://jquerybyexample.blogspot.com/2010/07/disable-specific-days-in-jquery.html

    To deactivate the days in the past, add this in: settings > Minimum Date: + 0d

    See you soon,.

    Tobias

  • How can I add days to a Date value in a Script time?

    How can I add days to a Date value in a Script (XPATH) time?

    XPATH:

    Add Date:

    xs:dateTime($yourCurrentDateVar) + xs:dayTimeDuration($yourDuration)
    

    Difference in date:

    move "fn:days-from-duration(xs:dayTimeDuration(xs:date($yourCurrentDateVar) - xs:date($yourPrevDateVar)))" to $diff;
    

    You did not mention the version of the Framework, you can take advantage of the Business Service (BS) to perform Date calculations, for example, for FW2.2.x, you can use BS: C1-DateMath with such options as the 'Resistance' to add to the Date, "DIFF" for Date-Diff and FW4.x, you can use BS: F1-DateMath with options such as "F1AD" to add to the Date etc.

    Find out more about XPATH herefunction.

  • find the difference in days between two dates

    Hello world

    I'm trying to find out the difference in days between two dates and the execution of the query that I'm passing

    SELECT TO_char(sysdate, 'dd/mm/yyyy') - TO_char('15/11/2011', 'dd/mm/yyyy') DAYS FROM DUAL

    the error I get is

    ORA-01722: invalid number
    01722 00000 - "invalid number."
    * Cause:
    * Action:

    Could someone please help.

    Thanks in advance

    user10636796 wrote:
    Hello world

    Thanks a lot for all the replies. I am trying to apply it in a statement to my table like this

    SELECT trunc (sysdate) - TO_char (date_last_recommended, ' dd/mm/yyyy') DAYS OF recommendation;

    SELECT trunc (sysdate) - TRUNC (date_last_recommended) DAYS OF recommendation;

  • Figure out how many years and days between two dates

    Nice day

    I've been dealing with the problem for a few days now so I thought that I could send it and see if someone can tell me what I'm doing wrong.

    / * Create a Date with a date object. */

    var d1 = getField "(RELEASE. DATE') .value;

    / * Create a date object containing the current date. */

    var d2 = getField("Text4").value;

    / * Number of years difference. */

    diff = (((d2.valueOf () - d1.valueOf (()) / 1000) / 60) / 60) / 24) / 365;

    Displays the field "Text3".

    getField("Text3").value = (diff); & #8232;
    < END >

    RELEASE. Value DATE is January 1, 2011, with a date format dd/mmm/yyyy

    Text4 value is March 1, 2011 with a date format dd/mmm/yyyy

    The release of Text3 gives me a 'NaN' result

    What I'm trying to do is calculated the number of years an employee has had with the company, and then display a balance of days that he had.

    Any thoughts would be greatly appreciated.

    repeated conversion from date string and number of days for the reuse of code
    function Date2Num (cFormat, cDate) {}
    Converts a date string formatted in days since the date of the time
    Kai var = util.scand (cFormat, cDate);
    Math.floor (oDate.getTime (return) / (1000 * 60 * 60 * 24));
    }

    / * Create a Date with a date object. */
    var d1 = (getField("Enrol_Day").value + "/" + getField("EnrolMonth").value + "/" + getField("EnrolYear").value);
    Converts a date in the date object string
    oD1 var = util.scand ("dd/mmm/yyyy", d1);
    get the current date of the field
    var d2 = (getField ("TD. RelDay") .value + ' / ' + getField ("TD. RelMonth") .value + ' / ' + getField ("TD. (RelYear') .value);

    calculate the difference in days
    diff var = Date2Num ("dd/mmm/yyyy", d2) - Date2Num ("dd/mmm/yyyy", d1);
    increment the value if the end date should be included in the calculation
    diff ++;
    convert days to truncate all years - to the next intiger lowest
    var carnavalSVP = Math.floor(diff / 365.25);
    get the current year interval - rest of diff days divided by 365.25 days
    var nDays = Math.floor (diff % 365.25);

    display the entered values
    CMSG var = ' end date: "+ d2 +" \t Compute days: ' "+ Date2Num (" dd/mmm/yyyy", d2);
    CMSG += "\nStart date:" + d1 + "\t Compute days: '" + Date2Num ("dd/mmm/yyyy", d1);
    Total difference in days
    CMSG += "\nTotal elapsed days:"+ diff;»
    result in years and days
    CMSG += "\nYears:" + carnavalSVP + "and" + nDays + 'days'; "."
    App.Alert (GSMC, 1, 0, "results");
    //

  • Calculate the difference in days between two Dates

    Hello

    I'm trying to understand how to calculate the difference in days between two dates using JavaScript in LiveCycle. (Minimum = JavaScript knowledge)

    Where 'Start_Date' and 'Current_Date' are the names of the two dates in the palette of the hierarchy. (the two Date/time field)

    * Current date is using the object > value > execution property > current Date/time

    I need a text or number field showing the difference in days. (Difference_in_Days)

    I noticed the following code is pretty standard among other responses:

    var

    Start_date = new Date (Start_Date);

    var

    Current_Date = new Date (Current_Date);

    var

    nAgeMilliseconds = Current_Date.getTime) - Start_date.getTime ();

    var

    nMilliSecondsPerYear = 365 * 24 * 60 * 60 * 1000 ;

    I know there is lack of code and code above are may not be not correct.

    Please notify.

    OK, that's because of the way that javascript and works of the calculate event.  The field will be filled with whatever the script resolves at the end of execution. Technically, your script does not have a value because the last thing you do is an assignment to a variable.  Change the last line as follows:

    Math.ABS ((firstDate.getTime)

    ((- secondDate.getTime (()) / (oneDay));

    (eliminate the variable assignment) and get rid of the app.alert.  Your script will "return" (have) regardless of the value of calculation from the East and which will be stored in the field.

  • Get the number of month, week and day between 2 dates

    Hi all

    Is it possible to display the number of months, weeks and days between 2 dates? by using only the SQL or PL/SQL...

    Entry:
    Date: October 1, 2010
    Date: October 19, 2010

    I want output like below (assuming starts the week from Monday to Sunday in oracle).

    October 1, 2010-(since it's in the middle of the week)
    October 2, 2010-(since it's in the middle of the week)
    October 3, 2010-(since it's in the middle of the week)
    40. (4 Oct-10 Oct falls into the 40th week of the year)
    41. (11 Oct-17 Oct falls into the 41st week of the year)
    October 18, 2010-(since it's in the middle of the week)
    October 19, 2010-(since it's in the middle of the week)


    Note: If there is a month between the date, the number of the month should be displayed.
    End of the month, the remaining date included with a full week, then the week of the year number should
    displayed. After posting the week, remaining dates should be displayed as it is...


    Appreciate your help...



    Thank you.
    Fox.

    You mean something like this...

    SQL> ed
    Wrote file afiedt.buf
    
      1  WITH t AS (select date '2010-09-27' as fdate, date '2010-11-21' as tdate from dual)
      2  --
      3  -- END OF TEST DATA
      4  --
      5  select dt2
      6  from (
      7        select dt,
      8               case when days_of_mn = days_in_month then 'Whole: '||to_char(dt,'Month')
      9                    when days_of_wk = 7 then 'Week: '||to_char(dt,'fmWW')
     10               else to_char(dt, 'DD-fmMonth-YYYY')
     11               end as dt2
     12              ,row_number() over (partition by
     13                 case when days_of_mn = days_in_month then to_char(dt,'Month')
     14                                  when days_of_wk = 7 then 'Week: '||to_char(dt,'fmWW')
     15                 else to_char(dt, 'DD-fmMonth-YYYY')
     16                 end order by dt) as rn
     17        from (
     18              select dt, wk, mn, days_in_month
     19                    ,count(*) over (partition by wk) as days_of_wk
     20                    ,count(*) over (partition by mn) as days_of_mn
     21              from (
     22                    select fdate+rownum-1 as dt
     23                          ,to_number(to_char(fdate+rownum-1,'fmWW')) as wk
     24                          ,to_number(to_char(fdate+rownum-1,'fmMM')) as mn
     25                          ,to_number(to_char(last_day(fdate+rownum-1),'fmDD')) as days_in_month
     26                    from t
     27                          connect by rownum <= tdate-fdate+1
     28                   )
     29             )
     30        ) x
     31  where rn = 1
     32* order by dt
    SQL> /
    
    DT2
    -----------------
    27-September-2010
    28-September-2010
    29-September-2010
    30-September-2010
    Whole: October
    Week: 44
    Week: 45
    Week: 46
    19-November-2010
    20-November-2010
    21-November-2010
    
    11 rows selected.
    
    SQL>
    

Maybe you are looking for

  • How to define the result of a call sequence of pass/fail

    Hi all in my application, I have a pass/fail with the adapter of the test sequence. The Source of data for the stage is Step.Result.PassFail. Is it possible to tell the appellant (the stage of appeal for success/failure sequence) the result within th

  • HP touch smart Office: product key

    My hard drive crashed. I bought a new. I have disks to reinstall the operating system, but she asks for product key. I don't know where it is or how to get it. I called hp tech line and they say that my computer is too old, they can't help me. Anyone

  • downsize fotos

    How tomake miniature of foto?

  • 8600 does not print

    Hello I bought a new computer with Windows 8.1 Asus.  I downloaded the driver for the 8600 and the printer to the troubleshooter.  Both give the same result, they recognize the network but not the printer.  I know that it recognizes the network becau

  • Photosmart 7520: cartridge printer problem

    There are 5 locations of the cartridge in the printer, and I never had no problem with cartridges before that.  Four of the five slots hold what I describe as 'slim' cartridges - 3 color, black. The fifth housing contains a cartridge slightly wide, b