Skip to main content
Nintex Community Menu Bar

Calculate Difference between two Date/time using Calculated value in The forms

  • October 28, 2014
  • 10 replies
  • 368 views

Forum|alt.badge.img+3

Hi all

I want to calculate the difference between two date/time using calculated value in the form, so that users can be able to see the difference when the view item

I tried using a calculated column but some how I cannot connect the calculated column to the column in the form in order to display/cannot display the column in the form

Regards

Thanks in advance!.

10 replies

Forum|alt.badge.img+4
  • Nintex Employee
  • October 28, 2014

Hi Michelle,

There are few ways of doing it.

You can create Form Variable and show that variable into calculated value control. please follow below steps:

  1. Create Form Variable
    1. Click on Form Variable button
    2. Click on formula, it should give you Formula Builder
    3. Select Runtime Functions
    4. Select either dateDiffDays, dateDiffHours or dateDiffMinutes, it depends on which formate you want
    5. Put your both date values
    6. Click Ok
  2. Add Calculated Value control on the form and add newly created variable into formula
  3. Publish form and it should work

Other option is , you can add Calculated Value control on the form and use above mention runtime function directly.

Thanks,

Shirin


Forum|alt.badge.img+12
  • October 29, 2014

Here is a pretty good tutorial using date difference already written on the forums:

How to complete Date Validation using Nintex Forms 2013 Validation Rules.


Forum|alt.badge.img+3
  • Author
  • October 29, 2014

Hi Shirin

Is it possible to make the format like this - 0 days, 01  hrs,  00  mins when calculating the date difference and how do I go about doing that?

Thanks


Forum|alt.badge.img+4
  • Nintex Employee
  • October 29, 2014

Hi Michelle,

There are 3 different runtime function (1) dateDiffDays (2) dateDiffHours (3) dateDiffMinutes.

I am sure it will help you to achieve what you after.

Let me know how you go. Let me know if you need help in your specific scenario in this, might try to create form for you and send you.

Thanks,

Shirin


Forum|alt.badge.img+3
  • Author
  • October 29, 2014

Hi Shirin

Yes I definitely need help please!

Thanks


Forum|alt.badge.img+4
  • Nintex Employee
  • October 29, 2014

Hi Michelle,

I have attached exported list form. Please import that and see if it helps.

Let me know if any questions.

Regards

Shirin


Forum|alt.badge.img+3
  • Author
  • October 30, 2014

Thank you that is what exactly I am looking for

And it helped

Thanks


Forum|alt.badge.img+5
  • February 8, 2016

hello Shirin Patel

i dont know how it works, not sure if the problem is in my form

i imported yours and i also had the same outcome

days: 2

hours: 48

minutes: 2880

i modified it to get the results i wanted like below

dateDiffDays(date1, date2) + "  days  " + (dateDiffHours(date1, date2)-24*dateDiffDays(date1, date2)) + "  hrs  " + (dateDiffMinutes(date1, date2)-(60*dateDiffHours(date1, date2))) + "  mins  "


Forum|alt.badge.img+5

Hi ‌, can you mark the answer to your question? I think this post would be helpful for other Nintex connect users. grin.png


Forum|alt.badge.img
  • Novice
  • July 1, 2020

Hi

I am designing an overtime form and the user can enter 3 different rows within a repeating section for each day.  I have used the following formula to calculate the hours and minutes worked but I need the total of the 3 entries to work out the total daily hours and minutes worked.

 

(dateDiffHours(StartTime,FinishTime)) + " Hours : " + (dateDiffMinutes(StartTime,FinishTime)-60*(dateDiffHours(StartTime,FinishTime))) + " Minutes"

 

Can anyone please advise what the formula is to calculate the 'sum' of the 3 daily entries?

Thank you