0

I am working on converting a Variable field to HH:MM:SS to display in a grid view. I am not sure how to write the expression. Can anyone assist?

Expression behind the variable is:

=Avg(Cdbl(IIF((Fields!ExitReason.Value = 7), IIF ((Fields!ExitReason.Value = 7), (Fields!DurationSeconds.Value) , (0)), 0)), "Group1")

Expression Variable is:

Variables!RACallsAbandonedAvPerGr3.Value

I am trying to convert to variable to HH:MM:SS an expression format in a grid field to display avg abandoned time. Example: Average Abandoned time 00:01:20

Thanks,

Arron Robles
  • 273
  • 1
  • 2
  • 10
  • What is your current time represented in? Seconds? – Bactos Feb 03 '15 at 18:48
  • yes seconds. i used the following expression.=Avg(Cdbl(IIF((Fields!ExitReason.Value = 7), IIF ((Fields!ExitReason.Value = 7), (Format(DateAdd("h", "m", "s" Fields!Duration.Value, "00:00:00"), "HH:mm:ss")) , (0)), 0)), "Group1") – Arron Robles Feb 03 '15 at 19:49
  • i used duration instead of durtionseconds and it still had an issue. – Arron Robles Feb 03 '15 at 19:52
  • I have modified my answer a bit, but you have to pick a duration type you want to represent (can only be one: H or M or S) Hour, Minutes, Seconds – Bactos Feb 03 '15 at 20:09
  • Ok, this partially worked, thank you. One question though. Is there a way to pick up the minute and second? The outcome could be 00:01:30. – Arron Robles Feb 03 '15 at 20:37
  • If you look at xan's responce on : http://stackoverflow.com/questions/5332217/how-to-display-a-time-span-of-seconds-in-hhmmss-format-in-reporting-services You can use some custom code. – Bactos Feb 03 '15 at 20:47

1 Answers1

1

If you use X as your base time (the time you are converting) you can do the following:

Format(DateAdd("x", Variables!RACallsAbandonedAvPerGr3.Value, "00:00:00"), "HH:mm:ss")

Just be sure to substitute your x for: Hours = "h"
or Minutes = "m" or
Seconds = "s".

You have to pick one of the types.

Bactos
  • 1,233
  • 14
  • 26