Add Days to date based on value in another field - InfoPath Dev
in

InfoPath Dev

Add Days to date based on value in another field

Last post 11-08-2019 08:16 AM by Hilary Stoupa. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 09-30-2014 05:03 AM

    Add Days to date based on value in another field

    Good afternoon,

    I am trying to add days to an expiry date field based on a variable value in a field that is a look up to a secondary data source i.e. it may be 30 days or 60 days depending on the content of another field.  However, I get ERR? in the date field.  If I just use the formula addDays(Quote Received Date, 30) then it works fine, but how can I get it work with the formula addDays(Quote Received Date, Daysfield) rather than defining the number of days? The value to be added will definitely vary due to the criteria within the form, which is why I have set up rules to correctly populate the number of days to be added in the Days field.

    I would be so grateful if anyone can please help!!

    Thanks 

  • 10-07-2014 02:53 AM In reply to

    Re: Add Days to date based on value in another field

    Hi d24n4e,

    Your formula is correct. using addDays(Quote Received Date, Daysfield) should work for adding or subtracting dates. Is your date picker's data type format set to date and time? Please try changing the format to date only or text and see if that works. If not, kindly attach a sample of your form so I could get a clearer idea of what isn't working for you.

    Regards, 

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 05-03-2015 10:39 PM In reply to

    Re: Add Days to date based on value in another field

    Did you ever resolve this issue? I'm having the same problem. I am using a text field however [Reminder], type is number, no decimals. The formula shows no errors, addDays(Reminder, today()), but when I test the form, the resulting date field shows an error when I set a 'Reminder' number.
  • 05-06-2015 07:40 AM In reply to

    Re: Add Days to date based on value in another field

    Aren't those backwards in the formula? https://support.office.com/en-gb/article/Add-days-to-a-date-fe3d1c01-2409-43f1-bfc4-8d7f953247a6?ui=en-US&rs=en-GB&ad=GB&fromAR=1

    I think you want addDays(today(), Reminder).

    Hilary Stoupa

  • 11-08-2019 08:05 AM In reply to

    Re: Add Days to date based on value in another field

    I am having an issues with adding dates I can get this to work addDays(equiporderbked, 180) however, when I try to submit the form in Sharepoint it says it can only be an integer. I change it to integer and republish same issue, change to string same thing. What am i missing to get this to work?
  • 11-08-2019 08:16 AM In reply to

    Re: Add Days to date based on value in another field

    Is this a list form? The type of column comes into play here. I'd assume the result of the addDays formula would be a date time?
    Hilary Stoupa

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