Foros del Web » Programación para mayores de 30 ;) » Bases de Datos General »

No Me Resulta El Porcentaje Porque???

Estas en el tema de No Me Resulta El Porcentaje Porque??? en el foro de Bases de Datos General en Foros del Web. HOLAS TENGO EL SIGUIENTE PROBLEMA QUIERO HACER ESTE PROCENTAJE PERO NO ME ESTA RESULTANDO declare @Total1 int declare @Cien float select @Total1 = sum(TOTAL), @Cien=100.0 ...
  #1 (permalink)  
Antiguo 11/11/2004, 07:31
 
Fecha de Ingreso: septiembre-2004
Mensajes: 141
Antigüedad: 19 años, 7 meses
Puntos: 0
No Me Resulta El Porcentaje Porque???

HOLAS TENGO EL SIGUIENTE PROBLEMA QUIERO HACER ESTE PROCENTAJE PERO NO ME ESTA RESULTANDO


declare @Total1 int
declare @Cien float
select @Total1 = sum(TOTAL), @Cien=100.0 from ##r1

--select @total1 from ##r1

select tipo_email ,total, @total1 AS TOTAL2,
(@TOTAL1/total) AS DIVIDE,
(TOTAL/@TOTAL1) AS DIVIDE2
---(( convert (float, count(*) ) / @Total1 )*100.0 ) as totalP
--convert(float,(@totalX) as Porcentaje
from ##r1
group by tipo_email,total
--( convert (decimal(8,2), count(*))/' + convert(varchar,@Total) + ')*100) as Porcentaje %
order by tipo_email

Y ME DA

tipo_email total TOTAL2 DIVIDE DIVIDE2
-------------------------------------------------- ----------- ----------- ----------- -----------
1 4 11 2 0
2 3 11 3 0
3 1 11 11 0
4 3 11 3 0

(4 row(s) affected)
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:50.