Hello everyone :) I have two values, of Time ...

(Stephane Grimaud) #1

Hello everyone :slight_smile: I have two values, of Time type (IgnoreSeconds: true) : - MorningBeginningHour - MorningEndingHour

I want appsheet to calculate the duration in AppFormula area, something like: TotalHours = [MorningEndingHour] - [MorningBeginningHour]

But the appformula TotalHours doesn’t work!

Appsheet tells me it must be Duration type or Time type. I tried both but nothin changes…

Any idea?


(Stephane Grimaud) #2

Of course, I want this TotalHours to be shown :slight_smile:

(Aleksi Alkio) #3

If your column types are time and your result column type is duration, you can calculate it like [MorningEndingHour] - [MorningBeginningHour].

(Stephane Grimaud) #4

Thanks Aleksi but… Error: "The expression is valid but its result type ‘Duration’ is not one of the expected types: Text "

(Aleksi Alkio) #5

Change the result column type to Duration

(Stephane Grimaud) #6

Thanks Aleksi. I understand why It wasn’t working: AppSheet don’t allow to change at the same time Column Type and Appformula.

Your solution works correctly when I change only the Column Type before saving. Then I put the Appformula and save again.

(Aleksi Alkio) #7

Actually… you can change them both at the same time if you don’t use expression builder.

(Stephane Grimaud) #8

Indeed, thanks again!