|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi Everyone
I have a database with an OrderItems table, containing (at least) 3 fields, namely ExtendedPurchasePrice, CurrencyConversion and ExtendedPurchasePriceSterling, all fields as doubles. I want to update ExtendedPurchasePriceSterling for each row with the result of the calculation ExtendedPurchasePrice / CurrencyConversion where ExtendedPurchasePrice is in (say) euros and the sterling CurrencyConversion is 1.45. UPDATE OrderItems SET ExtendedPurchasePriceSterling = ExtendedPurchasePrice / CurrencyConversion This works perfectly for each row, for example 4.50euros at 1.45, giving a result of 3.10344827586207. How can I round this down to 3.10 in the UPDATE string? Thanks in advance. Jonathan Trahair |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Hi,
On Dec 14, 2007 1:02 PM, J Trahair <j.trahair@foreversoftware.co.uk> wrote: > Hi Everyone > > I have a database with an OrderItems table, containing (at least) 3 fields, namely ExtendedPurchasePrice, CurrencyConversion and ExtendedPurchasePriceSterling, all fields as doubles. > > I want to update ExtendedPurchasePriceSterling for each row with the result of the calculation > ExtendedPurchasePrice / CurrencyConversion > where ExtendedPurchasePrice is in (say) euros and the sterling CurrencyConversion is 1.45. > > UPDATE OrderItems SET ExtendedPurchasePriceSterling = ExtendedPurchasePrice / CurrencyConversion > > This works perfectly for each row, for example 4.50euros at 1.45, giving a result of 3.10344827586207. > > How can I round this down to 3.10 in the UPDATE string? Use the ROUND() function. |
|
![]() |
| Outils de la discussion | |
|
|