25/08/2015, 13:12
|
| | Fecha de Ingreso: agosto-2008
Mensajes: 17
Antigüedad: 16 años, 4 meses Puntos: 0 | |
Respuesta: Multiplicar y Dividir una Columna GRACIAS POR TU RESPUESTA....
ESTE ES EL QUERY...
SELECT T0.DocNum AS 'FACTURA', T1.U_BKS_TIFO, T1.Dscription AS 'NOMBRE DEL FORMULARIO',
CASE WHEN T1.U_BKS_CAMI <> 0 THEN T1.U_BKS_CAMI WHEN T1.U_BKS_CAMI = 0 THEN
CONVERT(FLOAT,T1.Quantity) END AS 'CANTIDA',
T2.NAME AS 'MEDIDA DE PRENSA',
CASE WHEN T2.NAME = '11' THEN '11'
WHEN T2.NAME = '17' THEN '17'
WHEN T2.NAME = '2 5/6' THEN '2.83'
WHEN T2.NAME = '22' THEN '22'
WHEN T2.NAME = '3 2/3' THEN '3.6'
WHEN T2.NAME = '4 1/4' THEN '4.25'
WHEN T2.NAME = '5 1/2' THEN '5.5'
WHEN T2.NAME = '5 2/3' THEN '5.6'
WHEN T2.NAME = '7 1/3' THEN '7.3'
WHEN T2.NAME = '8 1/2' THEN '8.5' ELSE 'Not for'
END AS 'MEDIDA',
T1.LineTotal AS 'TOTAL'
FROM OINV T0 INNER JOIN
INV1 T1 ON T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
DBO.[@MEDIDA_PRENSA] T2 ON T1.U_Medida_Prensa = T2.CODE LEFT OUTER JOIN
DBO.[@MEDIDA_CONTRARIA] T3 ON T1.U_Medida_Contraria = T3.CODE LEFT OUTER JOIN
ORIN T4 ON T0.DocNum = T4.U_BPV_FAFE LEFT OUTER JOIN
DBO.[@EMBALAJE] T5 ON T1.U_EMBALAJE = T5.CODE
WHERE T0.DocDate BETWEEN '2015/07/01' AND '2015/07/31' AND T1.U_BKS_TIFO <> 'V' AND
T4.[U_BPV_FAFE] IS NULL
GROUP BY T0.DocNum, T1.U_BKS_TIFO, T1.Dscription, T1.U_BKS_CAMI, T1.Quantity, T2.NAME, T1.LineTotal
ORDER BY T1.U_BKS_TIFO |