October 13, 2011 at 10:05 am
It's a single equality comparison. It's going to be faster than a range comparison.
It will force the scales to be integer values. You won't be able to extend to "1.0-1.5" as a range. If that's okay, then use Floor instead of an actual range.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 13, 2011 at 10:30 am
What I need is another column showing percentage of each of record by
like
Convert(float,AVG(MyScale)) * 100 / SUM(AVG(MyScale))
but since I am using AVG, I cannot use SUM at the same time it errors out with:
cannot perform an aggregate function on an expression containing an aggregate
Thanks.
October 13, 2011 at 12:09 pm
Painfully, I got it working. The query is much more complex than the columns are gave you. What I end up doing is, I created another query that would give me the sum and then use that sum to divide the scale to get the percentage.
Time after time I always get help from experts on this site. This is the only forum that I use for my sql requirements. Thanks to the creator and the contributors.
Thanks for your time.
October 13, 2011 at 12:34 pm
You're welcome.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 14, 2011 at 12:15 pm
ROUND() function is another way you can try.
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply