Can I create a field that calculates number of days from a date field?

Hi all,
I need a field that will calculate the number of days elapsed whatever date is entered into the date field, and update that number of days based on the calendar/computer calendar date.  Does that make sense?
https://www.dropbox.com/s/arkmnsxjkl4r156/AFBS_FacilitySpecialCareList02.pdf
I set up the form so that my boss can add or subtract clients from the list.  Each client needs to have its own "Days since added to the list" number. Sorta like a little aging report.
Is this possible?
Many thanks,
Laura

Wow, I'm so stumped.  I tried to copy a bit of formcalc into the exit event for my current date field to try to make this happen, but I can't get it to work.
My  attempt at scripting is embarrassing, but here it is:
form1.sf1.CCSub.CCGroup.#subform[0].DateField2::exit - (FormCalc, client)
form1.sf1.CCSub.CCGroup.#subform[0].NumericField2.rawValue = Date2Num(DateField1, "MM-DD-YY") - Date2Num(DateField2, "MM-DD-YY")
and here's the file:
https://www.dropbox.com/s/arkmnsxjkl4r156/AFBS_FacilitySpecialCareList02.pdf
Can anyone help me get this right?
Sign me: One Lost Designer
Thanks!

Similar Messages

  • How to calculate number of days from a date field

    Dear BW Experts.
    I have a field 'Create Date' in the BEx query. Now we need to create a variable which should give the number of days from the date of running the query (sy-datum) to the Create Date.
    This will help the users to get records which are say, 30 days old (Sy-datum - create date = 30) or 10 days old etc.
    Could you suggest as to how to create this variable.
    Thanks,
    Sai

    Hi,
    Step 1: Create variable on "Create Date" with User entry processing type
    Step 2: Create a restricted KF for Sales & restrict it on "Create Date" to get "Sales on day"
    Step 3: Manipulate  the values of "Create Date" on which you could restrict  "Sales" again and again to get other values
    Step 4: Create one variable (ZPUTMNTH) for u201CMonth to Dateu201D with processing by u201CCustomer Exitu201D. This variable was created  on u201CDateu201D characteristics.
    Step 5 : Goto C-mod t-code and use EXIT_SAPLRRS0_001
    to calculate "month to date" user input is "Calday" Key Date
    WHEN 'ZPUTMNTH'.
    IF I_STEP = 2. "after the popup
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZPDATE'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(6). "low value, e.g.YYYYMM (200606) part of key date (20060625)
    L_S_RANGE-LOW+6(2) = '01'. u201C low value e..g. YYYYMM01 (20060601)
    L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW. "high value = input
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    ENDIF.
    Assign if helps.....
    Regards,
    Suman

  • Can I create order forms that calculate the exact total with taxes?

    Can I create order forms that calculate the exact total with taxes?
    The customer needs to know exactly how much everything will cost before submitting. I can handle the actual payment portion manually.

    thanks for the info;
    I'll inform the admin dude that they need an upgraded acrobat to do forms.

  • How to calculate number of days between two date in Template design?

    Hello guys
    I have a situation where I have to create a template that returns data, and one of the thing of the existing report is that there is a column that is actually the number of days between start date and end date columns..
    So in template, how would I be able to do the same? I have start date and end date columns on the template, now when I created another column using expression like end date - start date and preview the template, I am getting errors saying :
    Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert 03/31/2009 to number.
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1534)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:521)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
    Please advice
    Thanks

    Hi
    There is an extension function you can use, from the javadoc:
    date_diff
    public static long date_diff(java.lang.String format,
    java.lang.String fromDate,
    java.lang.String toDate,
    java.lang.String locStr,
    java.lang.String tzID)
    Method to get the difference between two dates in the given locale. The dates need to be in "yyyy-MM-dd" format. This function supports only Gregorian calendar.
    Parameters:
    format - the format to which the difference is required; allowed formats are y (for Year), m(for month), w(for week), d(for day), h(for hour), mi(for minute), s(for seconds) and ms(for milliseconds)
    fromDate - the first date
    toDate - the second date
    locStr - locale string -> lang-Territory
    tzID - timezone ID ->http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimeZone.html
    Returns:
    the difference in dates in the desired format
    For example
    <?xdoxslt:date_diff(‘d’,’2009-09-14’, ‘2009-09-20’,’en-US’,1)?>
    give a result of 6
    You can substitute in columns for the dates, just remember the date format required.
    Regards
    Tim

  • How to calculate number of days between fixed date and hire date in schema

    i want to calculate the number of days between a fixed date en the hire date (infotype 041)
    If i read the documentation  right, i should use the following command:
    HRS=YDXA02
    Variable 3 (the x) is the fixed data.
    My question is how do i program the variable x?
    Let's say the date 01.01.2008
    Any help would be welcome

    I assume we are talking about PCR for payroll. In this case look at documentation for operation NUM:
    OOOOOO
    Xnnnnn
    X     Table
    nnnnn Table field
    nn    Date type 'nn' from the Date Specifications infotype (0041)
         Date types are taken from table T548Y.
    Your operation would look like:
      NUM=Faaesb
          F          Fixed indicator for deadline calculation
           aa           Date type: Start date of period to be
                        calculated; if the date type is not 'nn,'
                        the second position is left blank.
             e          Unit, in which the duration is calculated:
                        T = days
                        W = week
    s         End date of period to be calculated:
              (blank)  End of current payroll period
              J        End of current calendar year
              A        Start of current calendar year
              B        Start of WPBP period
             No other specifications are possible.
    So it depends on what kind of fixed date you need.
    Hope it helps,
    Carlos.

  • Get Date x number of days before current Date

    How do you subtract x number of days from a Date object?
    Is there a better way than
    int x = 28; // number of days
    long minisPerDay = 24 * 60 * 60 * 1000;
    Date newDate = new Date (oldDate.getTime() - (x * minisPerDay );

    > How do you subtract x number of days from a Date object?
    Calendar c = Calendar.getInstance();
    c.setTime(yourDateInstance);
    c.add(Calendar.DATE, -x);
    Calculating Java dates: Take the time to learn how to create and use dates
    Working in Java time: Learn the basics of calculating elapsed time in Java
    Good luck! :o)
    ~

  • Number of days in given date/month

    Hi,
    Can you send query to find the number of days in given date/month
    Regards,
    Venkat.

    If you want No. of days between two date then you can just Subtract them. If you want the number of days in a month you can get the first and last day of the month and subtract them.
    Solution for a month.
    SQL> with t as (select to_date('&month','mmyyyy') as dt from dual)
      2  select (last_day(dt) - trunc(dt, 'mm'))+1
      3    from t
      4  /
    Enter value for month: 012009
    old   1: with t as (select to_date('&month','mmyyyy') as dt from dual)
    new   1: with t as (select to_date('012009','mmyyyy') as dt from dual)
    (LAST_DAY(DT)-TRUNC(DT,'MM'))+1
                                 31
    SQL> /
    Enter value for month: 022009
    old   1: with t as (select to_date('&month','mmyyyy') as dt from dual)
    new   1: with t as (select to_date('022009','mmyyyy') as dt from dual)
    (LAST_DAY(DT)-TRUNC(DT,'MM'))+1
                                 28
    SQL> /
    Enter value for month: 122009
    old   1: with t as (select to_date('&month','mmyyyy') as dt from dual)
    new   1: with t as (select to_date('122009','mmyyyy') as dt from dual)
    (LAST_DAY(DT)-TRUNC(DT,'MM'))+1
                                 31Edited by: Karthick_Arp on Feb 19, 2009 9:56 PM

  • Number of days between to dates

    Hello to all,
    I would like to define a formula to calculate number of days between two dates and update the value in a key figure.
    *operand: {Name of keyfigure,Fecha ini (Mes/Año),Fecha Fin (Mes/Año)}
    DATA FECHAINI  TYPE ZIOV_FEIN.
    DATA FECHAFIN TYPE ZIOV_FFIM.
    DATA INI             TYPE 0CALMONTH.
    DATA FIN            TYPE 0CALMONTH.
    DATA DIA_INI      TYPE D.
    DATA DIA_FIN     TYPE D.
    DATA DIAS          TYPE F.
    FOREACH FECHAINI, FECHAFIN.
      INI = FECHAINI.
      FIN = FECHAFIN.
    *C2DATE Determine end period date
      DIA_INI = C2DATE(INI, E).
      DIA_FIN = C2DATE(FIN, E).
      DIAS = DIA_FIN - DIA_INI.
    {ZIOV_DIAS,FECHAINI,FECHAFIN} = DIAS.
    ENDFOR.
    Problem: UPF057 type F conflicts with type D. 
    Help would be much appreciated.
    Regards,
    Patrícia

    The function is built in:
    CALL METHOD CL_RSAR_FUNCTION=>DATE_DIFF(
      EXPORTING I_DATE_1 = L_ARG2
                I_DATE_2 = L_ARG3
      IMPORTING E_RESULT = L_ARG1  )

  • Can I cause checking a box to add 1 to a calculated form field?  I have a field that sums the numbers entered in several previous fields and need to be able to add "1" if a checkbox is selected as well.

    Can I cause checking a box to add 1 to a calculated form field?  I have a field that sums the numbers entered in several previous fields and need to be able to add "1" if a checkbox is selected as well.

    I think it has something to do with the way the value of the check box is exported, but I'm not sure.  With nothing being exported to Data5, Data6 displays the sum of Data1-4 rounded down to the nearest whole number and updates automatically as Data1-4 are updated.
    Right now, assuming Data1-4 are 0, where data 5 is the output of the second example and any box is checked,  "1" is displayed in data5 but nothing is added to data 6. Selecting any other check box or deselecting that check box will cause data6 to add 1 even if data5 displays "0".  By way of example:
    Selecting Check box 16 results in Data5 displays 1 and Data6 displays zero.
    Then, if any or all of Checkbox17-20 are selected, Data5 displays 1 and Data6 displays 1.
    Then, if any or all of Checkbox17-20 are deselected, Data5 Displays 1 and Data6 displays1.
    Then, if Checkbox16 is deselected, Data5 displays 0 and Data6 displays 1.

  • Can I create a form that doesn't trigger Acrobat's JavaScript disabled / security issues warning?

    Hello,
    Can I create a pdf that doesn't trigger Acrobat's JavaScript is currently disabled and this document uses it for some features.  Enabling JavaScript can lead to potential security issues.
    I even get this error when I create a blank pdf.
    I'm not using any JavaScript in the form and the nature of the message might tend to be a bit scary to some people since it mentions enabling JS can lead to potential security issues.  I basically want to disable the messaging of a feature I'm not even using.
    Anyone know if this is possible and if so, how I go about it?
    Thank you.

    Hi,
    I too share your frustration!!
    Unfortunately I do not have a complete answer for you.
    From the start I must say that Stefan Cameron has been very helpful (http://forms.stefcameron.com/2010/01/14/acrobatreader-9-3-now-available/), however I have not had sufficient time available to deal with the issue (or find a satisfactory resolution).
    The original post that Srini shared with you related to an XFA form that had FormCalc and Javascript in it. I will now share with you another situation that is closer to your experiences.
    Sometimes where we have a complex solution/form, we often give our users a PDF with instructions and demonstrations. We generate these using Adobe products:
    LiveCycle Designer ES to generate the solution/form;
    Captivate to record the demonstration (.swf);
    Acrobat to package it up in a static PDF.
    The screen shots below are from a PDF that includes written instructions and six Flash (.swf) files. The PDF does NOT include fields/form objects and does NOT include any FormCalc or Javascript.
    One of the big sells in Acrobat 9 was that Adobe had fully integrated Flash (Adobe product, ex. Macromedia) into Acrobat 9. This mean that .swf files could run natively inside a PDF. Brilliant!!!  The website today is still pushing this message, for example:
    Now bear in mind that the following screenshots are from a PDF that does not contain any scripting - its sole purpose is to "inform" the user, "look as good as the work I put into it", incorporate instruction and "multimedia" in a "single polished file" and I should be "confident that my audience will be able to view my work exactly as intended".
    Not so!!
    When the user now opens the form, all looks OK. No warning. They can read the instructions and scroll down to the multimedia (.swf files).
    However when the user clicks on the multimedia, the yellow bar appears:
    I go through the "trust" process:
    And the PDF looks like it is OK, no yellow bar. When I click on the multimedia, it begins to play - yes!! BUT ONLY FOR A SECOND OR TWO AND THEN IT STOPS AND GOES BACK TO THE START - AGGGGHHHHHHH!!!!!. I would apologise for shouting, but this is beyond frustration. The work in capturing six screencasts in Captivate, annotating them, publishing to .swf and packaging up in Acrobat has been a complete waste of time. Worse than that I now have several PDFs out there, that do not work. Good advertisement for my business? I don't think so!!
    The document that Stefan provided (Managing JavaScript Execution in the Acrobat Family of Products) does not mention Flash/.swf as being a problem. However I would recommend that you go through this document, as it may help you.
    So, where to now? I don't know. The previous posts and Stefan's responses have several urls that may help. You should maybe consider logging your experiences as a bug (log at Adobe).
    In the meantime good luck,
    Niall
    UPDATE:
    This behaviour (.swf playing for only a few seconds) happens in PDFs where the .swf is inserted as legacy media to run in earlier versions of Acrobat/Reader. In this case Acrobat/Reader is making an external call to Flash Player. Hence the yellow bar. However it does not explain why the Flash video still does not play when trusted.
    If the .swf is added into the PDF as Flash media to run on Acrobat 9 and above, then it works without displaying the yellow warning bar.
    So maybe any feature of your PDF that calls an external resource is likely to show the yellow warning bar.

  • How can I create a slideshow that depicts only a version of a photo rather than the original? Since the original and new versions are saved together, the aperture slideshow often choices the original rather than the desired version to display/

    How can I create a slideshow that depicts only a version of a photo rather than the original?   Since the original and new versions are saved together, the aperture slideshow often choices the original rather than the desired version to display.

    There are two things we use the name "Slideshow" for in Aperture:  a Slideshow Album, used for making Slideshows, and the Slideshow that is made.  (Imho, it is a design mistake to not call the containers used to create Slideshows, Books, etc., "Albums".)
    The Slideshow will use the Album Pick from any Stack.  A good way to use Aperture is to promote the Image you want to regularly use (such as, for example, a Version with adjustments) to the top of the Stack.  This makes it the Stack Pick, and will be the default Album Pick.  If you haven't done that, you can still change the Album Pick for any Stack in a Slideshow Album.  Expand your Stack(s), select the Image in each Stack that you want to be the Album Pick (and thus shown in the Slideshow), and "Stacks➞Set Album Pick".  (Note the keyboard shortcut; there is also a Toolbar icon for this.)  The change is immediate.  The Slideshow will always show the Album Pick (or, if there is not one, the Stack Pick) for every Stack in your Slideshow Album.

  • In DPS/Indesign for iPad - How can i create a button that once tapped, will pre-populate an email?

    In DPS/Indesign for iPad - How can i create a button that once tapped, will pre-populate an email? like when you tap a recipe in Marth Stewart Every Day Food for example....

    http://forums.adobe.com/message/4190932

  • Can I create a button that copy's a certain test to my clipboard?

    Can I create a button that copy's a certain test to my clipboard?
    For example, when I click the button on the website, then the next time to paste somewhere, a specific text appears?
    If this is possible, could someone please explain how? =(

    Hi Travis,
    There is no native feature in Muse to achieve this. However, you can use custom code to achieve this. Please refer to the following link for the sample code : How to copy to the clipboard in JavaScript? - Stack Overflow
    Regards,
    Aish

  • Can you create a template that has a header and footer to forms?

    Can you create a template that has a header and footer to forms?

    Yes but how are they going to create the Landscape versions?
    The problem with doing it in Pages '09 as rotated content is that the Headers and Footers are not rotated and there is inherent clumsiness in the rotated content usually being too large for the page when viewed at 90°.
    Best to make it in two or more separate documents.
    Peter

  • Creating a button that will Copy my view from so I can paste it to MS Word

    Is there a way I can create a button that will copy my view from so I can paste it MS Word?
    I know I can select the entire form and copy and paste it, but is there a way to do it via a button similar to my "Print Form" button?
    Thank you.

    so there isn't a button that will copy the text my view form?
    instead of highlighting the data I want to easily copy it so I can paste it on a word document
    I came up with a script that when a item is highlighted I click the copy to clipboard and it copies the item.
    <script type="text/javascript">
    function CopyToClipboard()
    CopiedTxt = document.selection.createRange();
    CopiedTxt.execCommand("Copy");
    </script>
    but is there a way I can put in the script the area I want to start the copy from instead of highlighting the text first?
     

Maybe you are looking for