var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Can't have aggregate function in expression
Can't have aggregate function in expression is what I am getting when I try this:
=Avg & Format(Avg (([FFF]-(Avg([FFF]/3600)*3600))/60),"00") & ":" & Format(([FFF] Mod 60),"00")
However if I change it up to:
=Avg ([FFF]/3600)"00") & ":" & Format(Avg (([FFF]-(Avg([FFF]/3600)*3600))/60),"00") & ":" & Format(([FFF] Mod 60),"00")
It removes the issue but does not run it properly.
The result I am looking for is to take a time stamp of minutes (n.xxxx) to format into h:nn:ss but am having no luck.
Thanks in advanced...
This should do the trick:
The last part you'll have to figure out if you want to round seconds up or down.
=Format(Int(FFF / 60) & Int(FFF - Int(FFF / 60) * 60) & (FFF - Int(FFF)) * 60, "00:00:00")
Krvin, What Version of DB2 are you using and what is the operating system?
What I would do is calculate each part (hour, minute and second) separately and then concatenate the values to the correct format.
It appears that what you can't do is nest aggregate functions (going by you example).
I am also not sure why you need the AVG function when doing a time conversion.
Can you give an example of what your input is (I am guessing n.xxxx is minutes and seconds but I really don't know). If the xxxx is seconds, do you want to Round the value or Truncate?
After these questions are answered, I might be able to create a working SQL statement.
Can't have aggregate function in expression
I am using IBM DB2 v7.2 on Server 2003.
The n.xxxx = minutes with it being broke down into decimal. Also where the FFF is pointing to it is set to: FFF: DateDiff("s",[TEST_PERFORMED],[TEST_ACQUIRED])
This is what I have come up with but still am unable to get a correct result:
Any other thoughts?
Last edited by Krvin; 07-17-09 at