Como muestro flotante una division?

23/10/2004 - 03:59 por Wichury | Informe spam
Tengo la siguiente sentencia:
Select Desc, Value1/value2 from table

y el resultado es el siguiente:

Desc Expr1
METAL1 1er. 60
METAL2 1er. 2
METAL3 1er. 0
METAL1 2do. 56
METAL2 2do. 1
METAL3 2do. 1
METAL1 3er. 80
METAL2 3er. 3
METAL3 3er. 1

Preguntas similare

Leer las respuestas

#1 Eric Garza
23/10/2004 - 04:26 | Informe spam
Wichury:

Mediante CAST o CONVERT:

e.g.:
Select Desc, CAST(Value1/value2 as real) from table

Regards,
Eric Garza
AMIGE

"Wichury" wrote in message
news:
Mostrar la cita
#2 Wichury
23/10/2004 - 19:37 | Informe spam
Gracias Eric... pero ya intente con Cast y con Convert y sigue mostrandome el
valor absoluto redondeado del resultado.

"Eric Garza" wrote:

Mostrar la cita
#3 Liliana Sorrentino
25/10/2004 - 16:39 | Informe spam
Hola,
El convert deberás hacerlo sobre value1 o value2 de tu tabla que seguramente
son datos numéricos enteros. Eso se llama "precedencia de datos", fijate en
los BOL.
Liliana.

"Wichury" escribió en el mensaje
news:
Mostrar la cita
el
Mostrar la cita
Ads by Google
Search Busqueda sugerida