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 |
|
aash
Starting Member
11 Posts |
Posted - 2011-03-28 : 10:17:49
|
| Hi, This forum is very helpful for a newbee like me. I have been using MSACCESS for a while, now with migration to SQL Server I am trying to learn many things now.Select4100/((t.TotalKS)/(t.Mins) *60)*((t.TotalKS)/(t.Mins) *60)/(t.KSPerDoc) as Normfrom(selectSum(NOKES) as TotalKS,Sum(ETES - STES) As MinsFROM WINTPOPWHERE VSON = '333' and VDATE='1/3/2011' group by VDATE, VSON)tThis querey works without error but result is being truncatedresult of the calulation 4100/((t.TotalKS)/(t.Mins) *60) is 1.95 but this querey is truncating it to 1, so I am not getting the accurate result. From reading forums I came to know can use CAST, CONVERT or ROUND to correct this. But I am not exactly sure how to apply in my query. Experts Please help me! |
|
|
Ifor
Aged Yak Warrior
700 Posts |
Posted - 2011-03-28 : 10:22:39
|
| Try making the result a float, instead of an integer, by making the constants floats. ie Use 4100.0 and 60.0 |
 |
|
|
aash
Starting Member
11 Posts |
Posted - 2011-03-28 : 10:43:12
|
| :) Thats easy, Thanks a lot |
 |
|
|
|
|
|