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 |
|
hspatil31
Posting Yak Master
182 Posts |
Posted - 2011-12-23 : 08:26:51
|
| Dear All,I am using following select statement in my SP. I want to complete this 54 seconds in minute. Means output should shows 60.And If my duration is 96 then output should shows 120.Can anybody please tell me how to resolve this issue ? @duration = 54(In Second)SELECT @Duration_RoundedTo6 = (CASE WHEN (@duration%6) =0 THEN ROUND((@duration/6),0) ELSE ROUND((@duration /6 ) + 0.5 ,0) END ) * 6Output: 54Thanks and Regard'sHarish Patil |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-12-23 : 08:41:37
|
Did you mean rounding to the nearest 60. Would this work?(@duration+30)/60*60 |
 |
|
|
hspatil31
Posting Yak Master
182 Posts |
Posted - 2011-12-23 : 10:59:24
|
| Hello Friend,Thnks I resolved my issue.Thanks and Regard'sHarish Patil |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|