si sacamos el total de llamadas o de productos / el total de ventas seria de este modo:
Código SQL:
Ver originalSELECT
CAST((isnull((
SELECT COUNT (*)
FROM TWREGISTROTEL WHERE (FECHA_RTE >= CONVERT (datetime,'2012-07-01 00:00:00',102))
AND (FECHA_RTE <= CONVERT (datetime,'2012-07-31 23:59:59',102))
AND STATUS_RTE NOT LIKE '11%' AND STATUS='ventas'
),0))/CAST(isnull(total,0) AS DECIMAL(10,4)) AS DECIMAL (10,4))
FROM(
SELECT COUNT (*) AS total
FROM TWREGISTROTEL WHERE (FECHA_RTE >= CONVERT (datetime,'2012-07-01 00:00:00',102))
AND (FECHA_RTE <= CONVERT (datetime,'2012-07-31 23:59:59',102))
AND STATUS_RTE NOT LIKE '11%'
) t1
Con esto sacas un porcentaje en SQL server:
CAST((isnull(ventas,0))/CAST(isnull(total,0) AS DECIMAL(10,4)) AS DECIMAL (10,4)) AS percent
saludos!