Help needed using DateDiff Function multiple times on a single form - InfoPath Dev
in

InfoPath Dev

Help needed using DateDiff Function multiple times on a single form

Last post 01-20-2012 12:34 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-20-2012 12:22 PM

    • Durbs
    • Not Ranked
    • Joined on 09-09-2008
    • Posts 8

    Help needed using DateDiff Function multiple times on a single form

    I have a form that has 3 from dates and 3 To dates.

    I have injected the form with QRules and I am using the DateDiff function triggered by a rule on when users enter the To Field to return the amount of days between the Start and End date.
    The result of the query returns to the QRules 'Result' field which I have put on my form.
    Example Start Date 20-01-12 End Date 22-01-12 Results = 2
    Code: concat("DateDiff /date1=", ., " /date2=", startdate, " /component=days")

    Now on the same form I have another field (Not a repeatintg Table)
    Trip 2 Start Date (From2) Trip 2 End Date (To2)
    Again I use the Date Diff Function obviously this time referenceing the 2nd Start and End Date Fields
    Code: concat("DateDif / date1=", ., "/date2=", From2, "/component=days")
    The issue is (And I'm sure its just me not quite understanding how this works) How can I get the query to return the value for the second date to anything other than the QRules 'Result' Field and if I can't do that how do I get the second dates to return another value to the field other than '2' the value from the first query.

    Hope I explained that well enough.

    Appreciate any responses. 

  • 01-20-2012 12:34 PM In reply to

    Re: Help needed using DateDiff Function multiple times on a single form

    In your rule where you run the date diff function, copy the value of the results node to another field. Then you can run additional commands without worrying about it gettng overwritten.

    Hilary Stoupa

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