decimal
Posted in 2009
Topics: General Discussion
Hello, Im performing a query that results in a number like 2.93485723 But i just want that my query always return a number like PPP.DD. How can i do that?
Josep wrote: > I'm performing a query that results in a number like 2.93485723 > > But I just want that my query always return a number like PPP.DD. > > How can I do that? If you want the result to be shown to 2 decimal places, then you should round to 2 decimal places: SELECT ROUND(SomeValue, 2) FROM Wherever If you want something else, you'll need to explain more clearly the format you need. For example, it is not clear from your description how the query should display 10101.010101 (but if you only want 2 decimal places shown, then ROUND(SomeValue, 2) is still the right way to go). -=JL=-
On 18 jul, 18:53, Jonathan Leffler <jleff...@earthlink.net> wrote: > Josep wrote: > > I'm performing a query that results in a number like 2.93485723 > > > But I just want that my query always return a number like PPP.DD. > > > How can I do that? > > If you want the result to be shown to 2 decimal places, then you should > round to 2 decimal places: > > SELECT ROUND(SomeValue, 2) FROM Wherever > > If you want something else, you'll need to explain more clearly the > format you need. For example, it is not clear from your description how > the query should display 10101.010101 (but if you only want 2 decimal > places shown, then ROUND(SomeValue, 2) is still the right way to go). > > -=JL=- Thanks!