Calculate date/time from three different fields - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Calculate date/time from three different fields

Last post 09-29-2022 11:13 AM by clawrence. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-28-2022 11:45 AM

    • clawrence
    • Top 500 Contributor
    • Joined on 11-07-2008
    • Birmingham, AL
    • Posts 38

    Calculate date/time from three different fields

    Whew, it's been a while since I've had to be on here. Here's the problem I'm up against: working on modifying an existing form that has a date field (date), a start hour field (whole number), and a start minute field (whole number). I'm trying to calculate the full date/time with those fields so that I can then compare the field to now(). If that date time is not at least 24 hours from now(), I want to deactivate the submit button. Any ideas?
  • 09-28-2022 12:57 PM In reply to

    Re: Calculate date/time from three different fields

    Give the attached sample a try.... I used a default value to calculate the date time string from the fields, and you'll see I used some substring function to zero pad the hours field if needed. Then on the submit button, I compare that calculated field to now() + 1 to see if the datetime is > 24 hours away. Right click the linked file, save locally. Right click the saved file and select design. I haven't tested this in the browser, so you may want to give this form a quick test in the browser if you are using browser forms :)

    Hilary Stoupa

  • 09-29-2022 11:13 AM In reply to

    • clawrence
    • Top 500 Contributor
    • Joined on 11-07-2008
    • Birmingham, AL
    • Posts 38

    Re: Calculate date/time from three different fields

    Thank you, Hilary, you always come through!
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.