Forum Discussion

DanteTognoli's avatar
DanteTognoli
Qrew Captain
7 years ago

Convert a formula duration result into a numeric value

I am calculating duration based on timestamp values. I want to create a boolean return in another field if the value is over 14. The problem I have is that the ">" symbol will not work with duration values, and if I make the boolean field numeric it will not accept a value from the duration field it is referencing. Is there another way to say "greater than" using duration fields?

18 Replies

  • I am hiding some fields based on the duration of a period. When the duration exceeds 14 hours I have a field with the title "Duty time over 14 hours?" This is the field where I want it to return a number based on duration and then say "yes" if that is true (this is the part where the formula works by returning a number, but will not print out the "yes" response). That also triggers the hidden fields to appear so more information can be entered.
  • Maybe what you want is to conver the duration to text and add � Yes� if > 14 hours


    ToText(Round(ToHours([Period Duration]),1))


    & " Hours"


    & If([Period Duration]>hours(14), " Yes")
  • That sounds like what I am trying to do, I'll give it a try.  Thanks for all of the help so far!
  • So close...It printed the "yes" text but also included 15 hours, so it looked like "15 hours yes". I pulled out the "& 'hours'" segment and now it says "15Yes". Is there a way to hide the 15? Also I don't understand what the 1 in the first line is for. Is that the number of days in the [period duration] field?
  • It does that because that is what I thought you wanted.

    At this point I really have no idea what you would like the formula to do.

    I think you better explain with some clear examples of the possible results you want to see for various examples of different Period Durations.
  • The field "Over 14 Hours?" is where the formula resides. I would like it to say Yes if period duration is over 14 hours. 

  • Right, that was my first response to your question.

    If([Period Duration]>hours(14,)"Yes")
  • Hmm...not sure how I got so off in the weeds on that. I think I got mixed up after changing the field type to formula-text. Anyway, it works now. Thanks for all of your help.