Less and greater expression in duration types

AND([Time in] >= “07:15:33”, [Total Hours] < “002:00:00”)
error:
The expression is valid but its result type ‘Yes/No’ is not one of the expected types: Duration
is there a way to use this kind of expression in-app formula?

0 8 189
8 REPLIES 8

Change the column type from Duration to Yes/No.

the user input are time not text

I have no idea how that relates to your original question. What are you trying to do?

example:
if the duration is longer than 08:00 and less than 10:00 then it substract by 08:00 but if the duration is only less than 08:00 it becomes 00:00
so if user input 9 hours total in that colum it becomes 01:00 but if user input total for 2 hours it becomes 00:00

Your question is still very unclear.

What happens if it is greater than 10:00?

Why does your original expression reference two different columns? And why does it seem to be something completely different from this 8/10 hr requirement?

You can try this expression:

IFS(
  [duration] < "008:00:00" , "000:00:00" ,
  [duration] < "010:00:00" , [duration] - "008:00:00" ,
  TRUE , #result-for-greater-than-10#
)

Note that you can’t enter an expression into the same column that the data is being inputted into, which is what it maybe sounds like you’re trying to do. You’ll have to either use the expression in another column, or run it as an Action.

Also, please review this article:


so this is my expression, If total hours is 09:00 yes it worked it becomes 01:00 but if total hours is less than 08:00, let say total hours is 06:00 the outcome become -02:00 so basically, it only read the first sentence which is [Total Hours]<=“010:00:00”,[Total Hours]-“008:00:00” but it doesn’t read the last one which is [Total Hours]<=“008:00:00”, “000:00:00”)

The order of the condition-value pairs in IFS() matters, it will return the first matched one. 6 is less than 10, so it picks the <10 one since it is first. I ordered the condition-value pairs very purposefully in my suggested expression.

i see, Thanks a lot

Top Labels in this Space