List of years between two dates

Hello

I am new to Livecycle Designer and learning I will.

I have a few questions related to the same question.

1. is it possible to create a list of years between two dates, especially the exercises? (I'm in Australia so it's July 1 to June 30).

for example

User between two dates in date fields:

(Start Date of the project field) July 1, 2012 and (end Date of the project field) 30 June 2015

Have an auto list to fill out as below:

(List)

2013

2014

2015

or ideally

(List)

2012/13

2013/14

2014/15

linking this (if possible).

2. is it possible to have to repeat the lines created automatically in a table for each of the fiscal years indicated in the list above?

If either / both of them are possible help that someone could provide would be very appreciated.

Thank you

Ivan

Hello

Please find an example that shows what I think you would do here - https://workspaces.acrobat.com/?d=F9t-rLq3bapw2d-XY0dRuQ

I ran a few test cases and did not include the error handling to keep the code as easy to read as possible.

If you open the form and look at the code in the click event of the update button, then that's where all the magic happens.

Hope this helps

Malcolm

Tags: Adobe LiveCycle

Similar Questions

  • Calculate the (age) years between two dates

    Nice day!

    I have not been able to find an answer, that I was able to use in the archives or online and would be very grateful for the help.  I'm working with Adobe Acrobat Pro XI (not LiveCycle) and I have very little experience with programming (for the most part, copy / paste).

    I need to create a text box that calculates the number of years between two dates entered, i.e. the age when the date of birth and death are given.  Also, would be nice if she was a Virgin until the two were provided.  Anyone would be able to give me the code I need to put in the custom calculation script?

    Once again, any help would be much appreciated!  Thank you and have a wonderful day!

    For the fields for Date of birth DOB and DOD for the Date of death and age in complete years both by using a'd-mmm-yyyy' date format you can use a custom calculation to the JavaScript for the field of age as:

    function GetField (cName) {}
    get the field with error trapping object;
    oField var = this.getField (cName);
    test error;
    if(oField == null) app.alert ("error during the" + cName, 1, 0);
    Returns the field object;
    return oField;
    } / / end GetField function;

    function {Scand (cFormat, cString)
    using date string format convert object date;
    convert string to date using format;
    Kai var = util.scand (cFormat, cString);
    the value null is an error of conversion;
    if(oDate == null) app.alert ("Conversion error" cString "by using the format" + cFormat, 1, 0);
    date of return;
    Return to oDate;
    } / / end Scand function;

    clear the value of the field;

    Event.Value ="";
    get data dob and dod;
    var oDOB = GetField ("DOB");
    Var o = GetField ("DOD");

    treat only if DOB and DOD have value and are not null;
    If (oDOB! = null & o! = null & oDOB.value! = "" & oDOD.value!) = "") {}

    convert the DOB and DOD to date objects.
    oDOB var = util.scand ("d-mmm-yyyy", oDOB.value);
    O var = util.scand ("d-mmm-yyyy", oDOD.value);

    get the difference over the years;
    var Age = oDOD.getFullYear () - oDOB.getFullYear ();

    adjust for month of previous DOD DOB;
    If (oDOD.GetMonth)< odob.getmonth())="">

    adjust the DOD before DOB date in the month of birth;

    If (oDOD.GetMonth () == oDOB.getMonth () & oDOD.getDate ())< odob.getdate())="">
    Set the value of the field;

    Event.Value = Age;
    }

  • Balance sheet for a YEAR between two dates in the dashboard

    Hello

    Could someone help me please how can I calculate the 'balance of the CDA' between two different dates, who is invited to the dashboard? Means: we have an "effective date" and a "prior date" as a promt in the dashboard user who selects dynamically. When displaying in the report, it should show us the "CDA balance" between the two dates selected dynamically by users in the dashbowrd prompt. Please suggest.

    Thanking you,
    BK.

    Now that you understand the concept, it is easy to change the constant (i.e., 2011-01-01) to a variable.

    1) start with your repository variable that contains your current date: CURRENT_DATE

    (2) TIMESTAMPADD (SQL_TSI_DAY, DAYOFYEAR (CURRENT_DATE) *-1 + 1, CURRENT_DATE) is the SQL to get the first day of the year.

    Replace the hardcoded hard 01/01/2011 with the SQL above and now it will work for the beginning of the current year. You can change the SQL code for the beginning of a given year.

    Ex. TIMESTAMPADD (SQL_TSI_YEAR-1, TIMESTAMPADD (SQL_TSI_DAY, DAYOFYEAR (CURRENT_DATE) *-1 + 1, CURRENT_DATE)) you will get the start of "last year." This should help you with your problem.

    Now that you have everything, please mark the appropriate messages 'useful' and 'proper' and then mark the thread as answered and others if you are looking for a similar solution can easily find the answer. Thanks and good luck!

    Edited by: David_T November 28, 2011 07:56

  • Need help on the list of months between two Dates

    Hi all

    I have a table which has startdate and enddate and need a select to list all the months between these two dates for each given ID.
    I did some tests and could not figure out how to get the startdate and enddate table (instead of hard coding) tests in the select statement.

    Could someone please help on this (Oracle 11 g 2),
    Thanks in advance!


    create table testing(
    id          number,
    start_date  date,
    end_date    date);
    insert into testing values(100, to_date('05-FEB-2011', 'DD-MON-YYYY'), to_date('28-MAY-2011', 'DD-MON-YYYY'));
    insert into testing values(200, to_date('20-JUN-2011', 'DD-MON-YYYY'), to_date('28-DEC-2011', 'DD-MON-YYYY'));
    commit;
    
    select * from testing;
    
            ID START_DAT END_DATE
    ---------- --------- ---------
           100 05-FEB-11 28-MAY-11
           200 20-JUN-11 28-DEC-11
    
    Elapsed: 00:00:00.01
    
    *for testing.id = 100:*
    select to_char(add_months(to_date('05-FEB-2011', 'DD-MON-YYYY'), l - 1), 'YYYY-Mon') Dates
     from (select level l
           from dual
        connect by level <= months_between(trunc(to_date('28-MAY-2011', 'DD-MON-YYYY'), 'MONTH'),
                                           trunc(to_date('05-FEB-2011', 'DD-MON-YYYY'), 'MONTH')) + 1);
    
    DATES
    -----------------
    2011-Feb
    2011-Mar
    2011-Apr
    2011-May
    
    Elapsed: 00:00:00.01
    
    *for testing.id = 200:*
    select to_char(add_months(to_date('20-JUN-2011', 'DD-MON-YYYY'), l - 1), 'YYYY-Mon') Dates
     from (select level l
           from dual
        connect by level <= months_between(trunc(to_date('28-DEC-2011', 'DD-MON-YYYY'), 'MONTH'),
                                           trunc(to_date('20-JUN-2011', 'DD-MON-YYYY'), 'MONTH')) + 1);
    
    DATES
    -----------------
    2011-Jun
    2011-Jul
    2011-Aug
    2011-Sep
    2011-Oct
    2011-Nov
    2011-Dec
    
    7 rows selected.
    SQL> select * from testing
      2  /
    
            ID START_DAT END_DATE
    ---------- --------- ---------
           100 05-FEB-11 28-MAY-11
           200 20-JUN-11 28-DEC-11
    
    SQL> select  id,
      2          to_char(add_months(start_date,column_value - 1),'YYYY-Mon') dates
      3    from  testing,
      4          table(
      5                cast(
      6                     multiset(
      7                              select  level
      8                                from  dual
      9                                connect by add_months(trunc(start_date,'MM'),level - 1) <= end_date
     10                             )
     11                     as sys.OdciNumberList
     12                    )
     13               )
     14    order by id,
     15             column_value
     16  /
    
            ID DATES
    ---------- --------
           100 2011-Feb
           100 2011-Mar
           100 2011-Apr
           100 2011-May
           200 2011-Jun
           200 2011-Jul
           200 2011-Aug
           200 2011-Sep
           200 2011-Oct
           200 2011-Nov
           200 2011-Dec
    
    11 rows selected.
    
    SQL> 
    

    SY.

  • difference between two dates in the year/month/day in Obiee

    Hi gurus,

    I know this question have been asked and answered several times but I have a requirement that is a little different, then the previous ones.

    I want to calculate the difference between two dates in OBIEE10g in year/month/day format similar to the below SQL output

    SQL > select end_date, start_date,

    trunc (months_between (end_date, start_date) / 12) years.

    months of mod (trunc (months_between (end_date, start_date)), 12).

    End_date - add_months (start_date, trunc (months_between (end_date, start_date))) days

    t

    Thanks in advance

    SK

    Search for this

    "TIMESTAMPDIFF IN THE FORM OF MTHS # YEARS."

    or else

    To get the current mandate of employees since the date of hiring in the form of # years # mths or # year (s) # month (s)

    Concat (concat (cast (TIMESTAMPDIFF (SQL_TSI_Month, "Employee attributes". (((' ' Hiring last Date employee ", CURRENT_DATE) / 12 as char),"Year (s)"), concat (cast (MOD (TIMESTAMPDIFF (SQL_TSI_Month,"Employee attributes". (((((' ' Hiring last Date employee ", CURRENT_DATE), 12) as char), 'Month (s)'))

    Concat (concat (CAST (TIMESTAMPDIFF (SQL_TSI_YEAR, "Employee attributes". (((' ' Hiring last Date employee ", CURRENT_DATE) as CHAR),"Year (s)"), concat (cast (MOD (TIMESTAMPDIFF (SQL_TSI_Month,"Employee attributes". (((((' ' Hiring last Date employee ", CURRENT_DATE), 12) as char), 'Mth (s)'))

  • Number of weeks between two dates that are in the same or different year

    Hello

    How to calculate the number of weeks between two dates?

    for example. "" "17-mar-2013' and June 27, 2013" or June 15, 2013 "and" 25-mar-2014


    Thanks in advance.

    lukx

    Hello

    Looks like your date range is incorrect.

    Please try the below.

    SQL >-front right

    SQL > select D2 - D1 "days."

    2 round ((D2-D1)/7.0) "weeks."

    3 round (Months_between (d1, d2), 0) 'months '.

    (select 4

    5 TO_DATE ('20121201', 'YYYYMMDD') D1, D2 TO_DATE ('20130116', 'YYYYMMDD')

    6 from two

    (7) date_range;

    Elapsed days weeks months

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

    46         7         1

  • Behavior of days between two dates

    Hello!
    If anyone can help? ... with differences in Date? :

    All I want is to calculate the number of days between two dates:

    InitDate has been entered as 01/10/2010 planning, to recover is 20101001
    HireDate was entered into the 1980-10-01 planning, to recover is 19801001

    I tried

    NumDays = @DATEDIFF (InitDate, HireDate, DP_DAY);

    but give me only 0 and -1.



    When I try the regular difference:

    NumDays = InitDate - HireDate;

    He returned to 30,000 (which in the example is 20101001-19801001) - which should not.


    I use Essbase/Planning 11.1.1.2, I tried also to break dates in years and months using INT and operations, but when I want to get the calendar days he is ugly. The two dates live in the same block.

    Someone at - it an idea?

    Thank you very much!

    Hello
    Here's a piece of code in my trunk of code which may help you. This assumes you have string CDF pack (https://www.samplecode.oracle.com/tracker/tracking/linkid/prpl1004/remcurreport/true/template/ViewIssue.vm/id/S441/nbrresults/9)

    var y1, y2, m1, m2, d1, d2, difx1, difx2;

    FIX (SOLUTION YOUR MEMBERS HERE)
    "BLOCK MEMBER")

    Y1=@round ("Date of 1" / 10000,0);
    Y2=@round ("Date 2" / 10000,0);
    M1=@round (("Date 1"-y1*10000)/100, 0);
    M2=@round (("Date 2"-y2*10000)/100, 0);
    D1 = ' Date of 1 "-(y1*10000+m1*100);"»
    D2 = "Date 2"-(y2*10000+m2*100); "»

    difx1=@TODATEEX ("mm/dd/yyyy",
    @JconcatStrings (@LIST (@JgetStringFromDouble (m2,@_false,@_false), ' / ', @JgetStringFromDouble (d2,@_false,@_false), ' / ', @JgetStringFromDouble (y2,@_false,@_false)))
    )
    ) ;
    difx2 = @TODATEEX ("mm/dd/yyyy", @JconcatStrings (@LIST)
    @JgetStringFromDouble (m1,@_false,@_false), ' / '.
    @JgetStringFromDouble (d1,@_false,@_false), ' / '.
    @JgetStringFromDouble (y1,@_false,@_false))
    )
    );

    diff=@DateDiff (difx2, difx1, DP_DAY);
    )
    ENDFIX

    See you soon,.
    Alp

  • Calculate the hours between two dates

    Hello

    I have a requirement to count the hours with 2 given timestamps, something like:
    SQL> select ((to_date('22-oct-2012 13:00:00','dd-mon-yyyy hh24:mi:ss') - to_date('20-oct-2012 13:00:00','dd-mon-yyyy hh24:mi:ss'))*24) B from dual ;
    
             B
    ----------
            48
    However, I wish it would be that simple. I just need to count the hours between two timestamps for the hours of work for example, 08:00 - 17:00, MONDAY to Friday (excluding weekends).
    So lets say I have to count the hours between two dates above the result should be 18 hours not 48 (4 hours on 20/oct, 9 hours on 21/oct to 5 hours 22/oct).
    How can I achieve this? Any idea will be useful.

    Thank you

    My query generates a list of all the hours between the start and end time, filters on the hours that are outside of the hours of work and then account for the remaining lines. Change that to partial hours must just be a case of replace the two occurrences of 1/24 with 24/01/60, then - as say you - Division COUNT (*) by 60.

    There may be performance issues using techniques of generation of line like this, if you put this in a query involving the joining of several lines of other tables (for example where the dates of beginning and end are derived from several employees?) or in several days. If you don't find it then count the number of whole days (taking weekends into account) between dates and work on the partial days after that it could be better. This would probably involve a lot of statements of case (which I don't have time to test it now).

    Ben

  • No.of feb 29 s between two dates

    Hello

    I would like to calculate feb29 between two dates currently using connect by level , but it causes the problem of performance (50 M of data)

    (SELECT SUM (DECODE (TO_CHAR (start_date + LEVEL - 1,'dd - my '), 29 - feb', 1, 0)) double CONNECTION OF LEVEL < = SYSDATE - start_date + 1) ' no. OF. FEB29'
    using Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit


    Thank you-

    Small change required...

    with t as
    (select sysdate-10000 start_dt,to_date('01-Mar-2012','dd-Mon-yyyy') end_dt from dual)
    select start_dt,end_dt,st_year,end_year,sum(case when mod(yr,400)=0 then 1
                    when mod(yr,4) = 0 then 1
               else 0 end) cnt
    from(     select start_dt,end_dt,st_year,end_year,st_year+rownum-1 yr
         from (
              select  start_dt,end_dt,
                   extract(year from start_dt)+
                     case when extract(month from start_dt) < 3 then 0 else 1 end st_year,
                   extract(year from end_dt)+
                     case when extract(month from end_dt) >= 3 then 0 else -1 end end_year
              from t)
         connect by st_year+rownum-1 <= end_year
        )
    group by start_dt,end_dt,st_year,end_year
    
    SQL> /
    
    START_DT    END_DT         ST_YEAR   END_YEAR        CNT
    ----------- ----------- ---------- ---------- ----------
    11-may-1985 28-feb-2012       1986       2011          6
    
    SQL> /
    
    START_DT    END_DT         ST_YEAR   END_YEAR        CNT
    ----------- ----------- ---------- ---------- ----------
    11-may-1985 29-feb-2012       1986       2011          6
    
    SQL> /
    
    START_DT    END_DT         ST_YEAR   END_YEAR        CNT
    ----------- ----------- ---------- ---------- ----------
    11-may-1985 01-mar-2012       1986       2012          7
    

    Published by: JAC September 26, 2012 11:44
    formatting

    Published by: JAC September 26, 2012 12:07
    Subqueries can be avoided, added the goal of understanding

  • How can I determine if the current date is between two dates?

    I'm trying to post a link when grave the current date between two dates. I have setup the startdate and the enddate. When he falls between the startdate one date enddate, the link will be apear. The startdate and enddate have already been formatted previously, as mm/dd/yyyyy. I tried to use the following script, nothing will do. What I am doing wrong?

    < cfif startDate GTE #dateformat (now (), "MM/DD/YYYY") # AND enddate LTE #dateformat (now (), ' MM/DD/YYYY') # >

    Don't know what you're talking about. I used the #dateformat(date_entered, 'mm/dd/yyyy') # for years without problem. I googled the datediff function before posting here and what I've found is datediff determines the whole number of units by which date1 is less than date2. I don't know how this can help me.

  • photo selection between two dates

    In Photos

    It is possible to select photos between two dates?

    In Photos,.

    is it possible to select the photos between two dates?

    Thank you, thank you

    Yes.  With a smart album like this:

  • MaxL Script to clear the data between two dates

    Hi all

    I need advice to clear the data between two dates, I have three dimensions in my sketch, 'eno', 'hiredate' and the 'actualamount '.

    Now I need to erase the data between the date range, up to now, I have this script,

    Fix ("HireDate", "Eno")

    Difficulty (@relative ("00:00:00",0),@relative("eno",0)) 2015-07-15 "))

    CLEARDATA "sal."

    endfix

    ENDFIX

    These scripts only clears on a specific day, but I tried to write the script to clear between two dates, I surfed on a few sites, but no clear answers, finaanly came here, kindly help in this regard.

    Thanks in advance.

    Have you not tried the format of "startdate":"enddate" for example "August":"September."

    See you soon

    John

  • 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

  • Number of Saturdays between two dates

    Hello

    How can I get number of Saturdays between two dates, including the two dates?

    for example number of Saturdays between 09/05/2014 and 10/05/2014 is five

    Help, please

    I use oracle 10g

    SQL> with t
      2  as
      3  (
      4  select to_date('05/09/2014 ', 'dd/mm/yyyy') from_dt
      5       , to_date('05/10/2014 ', 'dd/mm/yyyy') to_dt
      6    from dual
      7  )
      8   select to_char(from_dt + (level-1), 'fmDay') day_
      9        , count(*) cnt
     10     from t
     11  connect
     12       by level <= to_dt - from_dt + 1
     13    group
     14       by to_char(from_dt + (level-1), 'fmDay');
    
    DAY_             CNT
    --------- ----------
    Saturday           5
    Thursday           4
    Tuesday            4
    Friday             5
    Wednesday          4
    Monday             4
    Sunday             5
    
    7 rows selected.
    
    SQL>
    
  • Days between two dates given

    Hi all

    I need the days between two dates given.

    Select to_date('25-mar-2014','dd-mon-yyyy') start_date, end_date to_date('30-mar-2014','dd-mon-yyyy')

    of the double

    Desired output:

    25

    26

    27

    28

    29

    30

    Thanks in advance.

    Kind regards

    Afzal.

    Select the level - 1 desired_output + to_number (to_char (start_date, 'dd'))

    of (to_date('25-mar-2014','dd-mon-yyyy') select start_date, end_date to_date('30-mar-2014','dd-mon-yyyy'))

    of the double

    )

    connect by level<=  end_date="" -="" start_date="" +="">

    DESIRED_OUTPUT
    25
    26
    27
    28
    29
    30

    Concerning

    Etbin

Maybe you are looking for