Hi,

On Dec 14, 2007 1:02 PM, J Trahair <[EMAIL PROTECTED]> 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.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to