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 |
|
JeffS23
Posting Yak Master
212 Posts |
Posted - 2008-01-01 : 15:18:59
|
| I need to apply the 4% increase to the product price. The original product price is son=mthing like this: 22.88 (money data type). After 4% increase, it becomes 23.7952 (money data type).How do I make the price to be 23.80 in SQL?Code I use: UnitPrice = UnitPrice * 1.04 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-01-01 : 15:49:18
|
| declare @up moneyset @up = 22.88select round(@up * 1.04, 2)select convert(decimal(4, 2), round(@up * 1.04, 2))Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
georgev
Posting Yak Master
122 Posts |
Posted - 2008-01-01 : 15:51:39
|
[CODE]DECLARE @x table (cash money)INSERT INTO @x(cash) VALUES(22.88)UPDATE @xSET cash = cash * 1.04SELECT cash , Round(cash, 2)FROM @x[/CODE] George<3Engaged! |
 |
|
|
|
|
|