Date Time Conditional Function

  • Joor_Interpretation
    Asked on June 17, 2024 at 2:46 PM

    Hello, I can't seem to get it to work but I need an "if" function that will:

    • Calculate the difference in minutes between date&time start & date&time end.
    • if the value is greater than "90", input that number into the "summary" field
    • if the value is less than "90", input 90 into the "summary" field


    thank you!

    Jotform Thread 16000691 Screenshot
  • Jefferson JotForm Support
    Replied on June 17, 2024 at 3:25 PM

    Hi Joor_Interpretation,

    Thanks for reaching out to Jotform Support. We can calculate the minute difference between the Date/time of Service: Start field and the Date/time of Service: End (anticipated) field and set the condition where if the value is greater than 90, we will reflect that value to the Summary field and if the value is less than or equal to 90, we will return the value 90 to the Summary field. Here's how to do it:

    1. In Form Builder, click on the Build tab in the orange navigation bar at the top of the page.
    2. Click on the Add Form Element button on the left side of the page.
    3. In the Form Elements window, click on the widgets tab.
    4. Drag a Form Calculation widget to your form and name it Summary. Date Time Conditional Function Image 1 Screenshot 70
    5. Click on the Settings tab in the orange navigation bar at the top of Form Builder.
    6. Select Conditions on the left side of the screen.
    7. Click +Add a New ConditionDate Time Conditional Function Image 2 Screenshot 81
    8. Select Update/Calculate Field and then set the conditions just like you see below: Date Time Conditional Function Image 3 Screenshot 92Date Time Conditional Function Image 4 Screenshot 103Date Time Conditional Function Image 5 Screenshot 114

    Here's the sample output:

    Date Time Conditional Function Image 6 Screenshot 125

    We also have a guide about Performing Date and Time Calculations that you can check out.

    Give it a try and let us know how it goes.


 
Your Answer