Forum Discussion

Dain's avatar
Dain
Frequent Visitor
8 years ago
Solved

dispaly Duration

Hi All...   Help needed one more time. I have two Time columns in my table.I want to find the difference of time and append this duration with some text.   time1           time 2              re...
  • v-jiascu-msft's avatar
    8 years ago

    Hi Dain,

     

    Try out this formula please.

    remarks =
    VAR minutes =
        DATEDIFF ( [time1], [time2], MINUTE )
    VAR h =
        INT ( minutes / 60 )
    VAR m =
        MOD ( minutes, 60 )
    RETURN
        IF (
            h = 0,
            "Duration is " & m
                & " Minutes",
            "Duration is " & h
                & " hours "
                & m
                & " Minutes"
        )

    display_duration

     

    Best Regards,

    Dale