I want to find the difference between the two date time fields and need to update in other duration field

venkataci
Kilo Contributor

I want to find the difference between the two date time fields and need to update in other duration field.

 

find_real_file.png   Log in Time and Logoff time are Date/ Time fields and Total Log time is duration field.

 

I have written server side script for this to work calling a glide ajax call. But it is not calculating the difference.

 

Client script:

find_real_file.png

 

 

Script include is:

 

find_real_file.png

 

Please help me to resolve it.

 

 

Thanks in Advance.

40 REPLIES 40

Hi,

Can you please mark one of our response correct and useful and close the thread.

Please let us know if you have additional questions.

 

Thanks.

Ok..

 

I am trying to find the difference between the two duration values using the same method.

 

can u help?

You'll need to use subtract to get the difference between 2 duration fields, dateDiff is for date/time fields:

 

var duration1 = current.duration1_field //or wherever your duration1 field is
var duration2 = current.duration2_field //or wherever your duration2 field is
var duration = duration1.subtract(duration2);
var finalDuration = duration.getDurationValue();

 

 

venkataci
Kilo Contributor

It did not worked for  me...

Didn't above method work for you?