Calculating Total Number of Days Based Off 4 Different Date Picker Fields - InfoPath Dev
in

InfoPath Dev

Calculating Total Number of Days Based Off 4 Different Date Picker Fields

Last post 02-13-2013 07:50 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-12-2013 01:01 PM

    Calculating Total Number of Days Based Off 4 Different Date Picker Fields

    Hello all,

    I apologize in advance if this topic has been posted in the past. I have searched through the forum and attempted numerous techniques posted but have been unable to get this to work. I figure my situation is quite unique, therefore the threads found here may not apply to my situation so I decided to inquire about my issue in its own thread.

    Anyways, here's the situation:

    I am attempting configure a field within my InfoPath form, that calculates total number of days a patient has spent within the ICU. The total number of days is to be calculated based off of  4 different fields, which are all bound to Date Picker controls. I am using InfoPath 2013, and the form is in compatibility mode since it is a browser enabled form, hosted on a server running SharePoint 2007.

    Essentially, this is what I am trying to do:

    Names of the 4 different fields involved in the calculation:

      1. Admission_Data_icu_admit_date 
                • (Data type: Date (date))
      2. Admission_Data_transfer_date
                • (Data type: Date (date))
      3. Admission_Data_icu_readmission_date 
                • (Data type: Date (date))
      4. Admission_Data_second_transfer_death_date 
                • (Data type: Date (date))

    Name of field the calculated value will appear in:

    1.  Admission_Data_total_icu_days 
              • (Data type: Text (string))

    ( (Admission_Data_second_transfer_death_date) - (Admission_Data_icu_readmission_date) ) + ( (Admission_Data_transfer_date) - (Admission_Data_icu_admit_date) ) = Admission_Data_total_icu_days

     

    I have attempted multiple approaches using rules, but to no avail.

    If anyone can provide me some insight, or point me in the right direction, I would sincerely appreciate it.

     

    Filed under:
  • 02-13-2013 07:50 AM In reply to

    Re: Calculating Total Number of Days Based Off 4 Different Date Picker Fields

    InfoPath has a function to add days to a date, but nothing built in for calculating the differences between them. qRules can do this for you (and much more) if a third party tool is allowable in your environment. Otherwise, I have seen some rule-based date calculations - here's a sample form that someone posted the other day while we were trying to work out why a time calculation wasn't working any longer when he upgraded to IP 2010.

    Hilary Stoupa

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