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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 divide question

Author  Topic 

asarak
Starting Member

36 Posts

Posted - 2006-05-08 : 04:10:38
Hi ,
i want to have the following...

sum_a, full_sum, (sum_a/full_sum)*100

sum_a is int
sum_b is int

the divide returns me 0 if sum_a is less than full_sum
and if sum_a is equal to full_sum i take 100
* its obvious that sum_a could never be greater than full_sum

Any help??
thanks a lot
ASA

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-05-08 : 04:17:35
sum_a, full_sum, (sum_a/Cast(full_sum as Float))*100

If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them.
Go to Top of Page

asarak
Starting Member

36 Posts

Posted - 2006-05-08 : 04:31:37
it is fine.....
thanks a lot....
Brgrds
ASA
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-08 : 04:34:54
or
(sum_a * 100.0 / full_sum)




KH

Go to Top of Page
   

- Advertisement -