Subtracting Days Based on 1 Fields Value - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Subtracting Days Based on 1 Fields Value

Last post 12-19-2014 09:15 AM by sicky. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-19-2014 08:39 AM

    • sicky
    • Not Ranked
    • Joined on 03-01-2013
    • Posts 22

    Subtracting Days Based on 1 Fields Value

    Hi All,

    Ive been trying to get this work, but im at a lost.
    I have 2 Fields:

    Date: (with a Type set as Date, Formatted as Day, Date, Year, Ie Friday, 19th 2014, with a Default value of Today()
    Backup Date ( Same as above , but with no default value set)

    What im looking for is:
    When the Date Field contains, Tuesday Wednesday Thursday Friday it sets the Date on the Backup Date field to Today(), -1. I can set the Backup Date field with a default off Adddays(Date, -1) to get that value.

    However When the Date field contains Monday, i need the Backup Date to say the Friday before, so my calculation would be set Adddays(Date, -3) however i can get this to work.
    I have the following set on Rules for both Date, and Backup Date fields. :
    Date Contains "monday" Set Field Backup Date addDays(Date, -3)
    for both fields i fell into that trap before , but i cannot get it working.

    Any ideas anyone?
  • 12-19-2014 08:59 AM In reply to

    Re: Subtracting Days Based on 1 Fields Value

    Unfortunately, even though you have the date formatted to include the day of the week, the actual XML value won't have it - it will be 2014-12-18 or whatever the actual date is.

    So - you'll need a way to get the day of week given a date. This can be done with code (or qRules) - and there may already be an existing free web service somewhere that does this - I did a quick search and didn't see anything but it may be worth investigating a bit. Sorry I don't have better news for you!

    Hilary Stoupa

  • 12-19-2014 09:15 AM In reply to

    • sicky
    • Not Ranked
    • Joined on 03-01-2013
    • Posts 22

    Re: Subtracting Days Based on 1 Fields Value

    Thanks for the reply Hilary,

    Ill have a search around thank you again.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.