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
 General SQL Server Forums
 New to SQL Server Programming
 update not working

Author  Topic 

Vack
Aged Yak Warrior

530 Posts

Posted - 2008-09-03 : 11:26:22
Trying to run the following script on a table It is not updating the rebate_amt.

begin
update OrderRebate
set rebate_amt = (price*(.01*rebate_pct))
where rebate_pct > 0
end

I have a number of records where I do have a price and a rebate_pct >0
but the rebate_amt still shows zero.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-03 : 11:29:38
How are your Rebate_Pct stored?
Is 50% stored is 50.00 or 0.50?

There is a real difference for Price $25

25 * .01 * 0.50 = 0.125 which rounded is 0
25 * .01 * 50.00 = 12.5 which rounded is 12 or 13 depending on how you round.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -