Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
nikoo56
Starting Member
26 Posts |
Posted - 2012-03-15 : 14:17:38
|
I have this expression that return number like 320,Avg(Fields!final_rep_response1.Value)How I can write an expression the way that shows 300 as Hour:Minuteslike: 5:19 |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-03-15 : 15:11:25
|
Something along the lines of:CStr(Fix(Avg(Fields!final_rep_response1.Value)/60)) & ":" & CStr(Avg(Fields!final_rep_response1.Value) Mod 60) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
nikoo56
Starting Member
26 Posts |
Posted - 2012-03-15 : 19:53:45
|
How I can round it to 2 digits. This is returning: 3.22222 I like to return for example: 3.22quote: Originally posted by sunitabeck Something along the lines of:CStr(Fix(Avg(Fields!final_rep_response1.Value)/60)) & ":" & CStr(Avg(Fields!final_rep_response1.Value) Mod 60)
|
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-15 : 22:48:38
|
quote: Originally posted by nikoo56 How I can round it to 2 digits. This is returning: 3.22222 I like to return for example: 3.22quote: Originally posted by sunitabeck Something along the lines of:CStr(Fix(Avg(Fields!final_rep_response1.Value)/60)) & ":" & CStr(Avg(Fields!final_rep_response1.Value) Mod 60)
use Round() functionCStr(Fix(Avg(Fields!final_rep_response1.Value)/60)) & ":" & CStr(Round(Avg(Fields!final_rep_response1.Value) Mod 60,2))------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|