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 |
|
Mondeo
Constraint Violating Yak Guru
287 Posts |
Posted - 2008-06-11 : 09:43:27
|
| I need to add 3% to my pricesUPDATE prices SET price = price * 1.03But I also need to round up to the nearest 99p so for example 1.13 becomes 1.99How can I do this, I presume I need to round up to the nearest whole number, i.e. Math.Ceiling and then -0.01 but I dont know the syntax in SQL.Thank you |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-06-11 : 09:50:36
|
UPDATE prices SET price = ceiling(price * 1.03) - 0.01 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-11 : 09:58:16
|
| Would this work too?UPDATE prices SET price = cast(price * 1.03+1 as int) - 0.01MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|