adding an expiration date from two other fields in form - InfoPath Dev
in

InfoPath Dev

adding an expiration date from two other fields in form

Last post 09-27-2012 08:36 AM by Anson Hidajat. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-26-2012 12:58 PM

    adding an expiration date from two other fields in form

    I am creating a form that I want a calculated field - Expiration Date.  This field will be a calcuation of the setup date of an item, and another field that holds a number for the number of months to add onto the setup date to equal my expiration date.  For example, my setup date is September 20, 2012.  The item will expire 36 months from that date.  It does not have to be an exact date, just the month and year are really all I need.

     Is there a fairly simple formula that I can use to create this new field?

     Thanks in advance for any help!!

    Filed under: ,
  • 09-26-2012 02:44 PM In reply to

    Re: adding an expiration date from two other fields in form

    You could you use string parsing (substring) to extract the year and month from the date value.  Then all you would need to do add 3 to the year and you would have your month/date for the expiration.
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 09-27-2012 07:06 AM In reply to

    Re: adding an expiration date from two other fields in form

    Can you give me an example?  I dont know string parsing.

     Thanks!!

  • 09-27-2012 08:36 AM In reply to

    Re: adding an expiration date from two other fields in form

    No problem.  The following function will get you the year.  Simply replace today() with the field that you need to extract the year from.

    substring(today(), 1, 4)

    Likewise, this function will get you the 2 digit month.

    substring(today(), 6, 2)

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.