Board index » delphi » function to round of SQL-92

function to round of SQL-92

Hi,

First of all, sorry for my English.
Can I use some function to round a numerical data to only two decimals in a
SQL query?
I need the values in only two decimals (to convert a value from pesetas to
Euros).

Tahnk's for all

 

Re:function to round of SQL-92


How about ROUND?

rb

Quote
"Ladrillo" <programac...@elladrillorojo.com> wrote in message

news:3cbec8ac_1@dnews...
Quote
> First of all, sorry for my English.
> Can I use some function to round a numerical data to only two decimals in
a
> SQL query?

Re:function to round of SQL-92


This is for MS SQL Server...

Syntax
ROUND ( numeric_expression , length [ , function ] )

Arguments
numeric_expression

Is an expression of the exact numeric or approximate numeric data type
category, except for the bit data type.

length

Is the precision to which numeric_expression is to be rounded. length must
be tinyint, smallint, or int. When length is a positive number,
numeric_expression is rounded to the number of decimal places specified by
length. When length is a negative number, numeric_expression is rounded on
the left side of the decimal point, as specified by length.

function

Is the type of operation to perform. function must be tinyint, smallint, or
int. When function is omitted or has a value of 0 (default),
numeric_expression is rounded. When a value other than 0 is specified,
numeric_expression is truncated.

Quote
"Ladrillo" <programac...@elladrillorojo.com> wrote in message

news:3cbec8ac_1@dnews...
Quote
> Hi,

> First of all, sorry for my English.
> Can I use some function to round a numerical data to only two decimals in
a
> SQL query?
> I need the values in only two decimals (to convert a value from pesetas to
> Euros).

> Tahnk's for all

Other Threads