Time Calculations? I have a column for Deliv...

(Jim Davidson) #1

Time Calculations?

I have a column for Delivery Time (Type = Time) - this is a specified time that delivery should take place. I have an additional column called Actual Time (Type = ChangeTimestamp) - This is the actual time the delivery took place.

How can I calculate the difference between the 2 times?

Delivery Time = 10:49:28 AM Actual Time = 23/03/2018 12:21

Thanks in advance

(Philip Garrett) #2

@Jim_Davidson

You can use an expression like the following. It takes the DeliveryTime and converts it into a DateTime. It then subtract the two DateTime values.

[ActualTime]-(TODAY() + ([DeliveryTime] - “00:00:00”))

Although the expression works, I think it would be better to make DeliveryTime a DateTime column. This has two advantages:

  1. It allows you to capture the delivery date so you avoid problems when the two DateTimes are not on the same date.

  2. It makes the expression more obvious. You are simply subtracting two DateTime values to yield a Duration value.

(Jim Davidson) #3

@Philip_Garrett_Appsh Thank you - I took your advice and made the delivery time a date time column which works so much better. Thank you.