format 0 to hh:mm:ss inside IIF

  • Hi,
    I need to format devision between 2 fields in hh:mm:ss format:  (Fields!Return_Call_Hold_Time_sec.Value / Fields!Connected_To_An_Agent.Value)
    Problem starts when usinf iff denominator=0 (Fields!Connected_To_An_Agent.Value=0) , then I need to set 00:00:00 and I'm Having an Error.
    I have tried formating 00:00:00 to mm:hh:ss but couldn't find the correct way...

    =IIF(Fields!Connected_To_An_Agent.Value=0,????, format(DateAdd("s", (Fields!Return_Call_Hold_Time_sec.Value / Fields!Connected_To_An_Agent.Value), "00:00:00"), "HH:mm:ss"))

    Thanks!

  • Found a solution - the IIF should be inside the dateadd:
    =format(dateadd("s",IIF(Fields!Connected_To_An_Agent.Value="0","0", (Fields!Return_Call_Hold_Time_sec.Value / Fields!Connected_To_An_Agent.Value)),"00:00:00"),"HH:mm:ss")

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply