Hello I need to find a function tha allowed to obtain the following result:
SELECT FFFF(14.9879,2)
go
14.98
which function I must use?
What about
Select ROUND(14.98756,2,1)
Would be some numeric chopping, else you should use LEFT funtion with
CHARINDEX.
HTH, Jens Suessmeyer.
"pippo" <pippo@.discussions.microsoft.com> schrieb im Newsbeitrag
news:4934B137-6A93-4824-AA7C-DD80387A206B@.microsoft.com...
> Hello I need to find a function tha allowed to obtain the following
> result:
> SELECT FFFF(14.9879,2)
> go
> 14.98
> which function I must use?
>
|||SELECT ROUND(14.9879,2,1)
Using 1 as the third parameter causes ROUND to truncate (round down).
This won't necessarily cause your application to *display* only two
decimals. The display format of numeric values is determined by your
application, not by SQL Server.
David Portas
SQL Server MVP
Showing posts with label tha. Show all posts
Showing posts with label tha. Show all posts
Saturday, February 25, 2012
round
Hello I need to find a function tha allowed to obtain the following result:
SELECT FFFF(14.9879,2)
go
14.98
which function I must use?SELECT ROUND(14.9879,2,1)
Using 1 as the third parameter causes ROUND to truncate (round down).
This won't necessarily cause your application to *display* only two
decimals. The display format of numeric values is determined by your
application, not by SQL Server.
--
David Portas
SQL Server MVP
--|||What about
Select ROUND(14.98756,2,1)
Would be some numeric chopping, else you should use LEFT funtion with
CHARINDEX.
HTH, Jens Suessmeyer.
"pippo" <pippo@.discussions.microsoft.com> schrieb im Newsbeitrag
news:4934B137-6A93-4824-AA7C-DD80387A206B@.microsoft.com...
> Hello I need to find a function tha allowed to obtain the following
> result:
> SELECT FFFF(14.9879,2)
> go
> 14.98
> which function I must use?
>
SELECT FFFF(14.9879,2)
go
14.98
which function I must use?SELECT ROUND(14.9879,2,1)
Using 1 as the third parameter causes ROUND to truncate (round down).
This won't necessarily cause your application to *display* only two
decimals. The display format of numeric values is determined by your
application, not by SQL Server.
--
David Portas
SQL Server MVP
--|||What about
Select ROUND(14.98756,2,1)
Would be some numeric chopping, else you should use LEFT funtion with
CHARINDEX.
HTH, Jens Suessmeyer.
"pippo" <pippo@.discussions.microsoft.com> schrieb im Newsbeitrag
news:4934B137-6A93-4824-AA7C-DD80387A206B@.microsoft.com...
> Hello I need to find a function tha allowed to obtain the following
> result:
> SELECT FFFF(14.9879,2)
> go
> 14.98
> which function I must use?
>
round
Hello I need to find a function tha allowed to obtain the following result:
SELECT FFFF(14.9879,2)
go
14.98
which function I must use?What about
Select ROUND(14.98756,2,1)
Would be some numeric chopping, else you should use LEFT funtion with
CHARINDEX.
HTH, Jens Suessmeyer.
"pippo" <pippo@.discussions.microsoft.com> schrieb im Newsbeitrag
news:4934B137-6A93-4824-AA7C-DD80387A206B@.microsoft.com...
> Hello I need to find a function tha allowed to obtain the following
> result:
> SELECT FFFF(14.9879,2)
> go
> 14.98
> which function I must use?
>|||SELECT ROUND(14.9879,2,1)
Using 1 as the third parameter causes ROUND to truncate (round down).
This won't necessarily cause your application to *display* only two
decimals. The display format of numeric values is determined by your
application, not by SQL Server.
David Portas
SQL Server MVP
--
SELECT FFFF(14.9879,2)
go
14.98
which function I must use?What about
Select ROUND(14.98756,2,1)
Would be some numeric chopping, else you should use LEFT funtion with
CHARINDEX.
HTH, Jens Suessmeyer.
"pippo" <pippo@.discussions.microsoft.com> schrieb im Newsbeitrag
news:4934B137-6A93-4824-AA7C-DD80387A206B@.microsoft.com...
> Hello I need to find a function tha allowed to obtain the following
> result:
> SELECT FFFF(14.9879,2)
> go
> 14.98
> which function I must use?
>|||SELECT ROUND(14.9879,2,1)
Using 1 as the third parameter causes ROUND to truncate (round down).
This won't necessarily cause your application to *display* only two
decimals. The display format of numeric values is determined by your
application, not by SQL Server.
David Portas
SQL Server MVP
--
Subscribe to:
Posts (Atom)