on 08-19-2015 3:12 PM
Hola
Estimados
Estoy mejorando un query reporte de ventas que tengo, pero por alguna razon hay un campo que no puedo dejar con los 2 decimales que necesito, cuando lo veo en SQL muestra los 2 decimales pero al llevarlo al query manager lo redondea, he probado varias formas pero no logro llegar a la meta, el campo es el TotalFrgn de la tabla INV1. Abajo un pequeño extracto del query
select
DocEntry
Quantity,
(CASE
WHEN Quantity > '1' then (LineTotal / Quantity)
WHEN Quantity = '0' then (LineTotal * 1)
else '0' END) 'Precio Unitario CLP',
LineTotal 'Total Linea CLP',
Price 'Precio Unitario EX',
TotalFrgn 'Total Linea EX'
from INV1
El campo que no me lleva los 2 decimales el TotalFrgn
Saludos y gracias!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Por como indicas en tu mensaje, te puede funcionar de esta forma el query:
select
DocEntry
, Quantity
, CASE
WHEN Quantity > '1' then (LineTotal / Quantity)
WHEN Quantity = '0' then (LineTotal * 1)
else '0' END 'Precio Unitario CLP'
, LineTotal 'Total Linea CLP'
, Price 'Precio Unitario EX'
, convert(decimal(19,2),TotalFrgn) 'Total Linea EX'
from INV1
Te faltaba también una coma entre DocEntry y Quantity.
Si no es lo que esperas, sería conveniente que postees una muestra del resultado que esperas desde Excel o algún editor con columnas.
Saludos y suerte...
JC
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.