1
good afternoon! I have this basic process in SQL Server, which brings me the spending percentage:
DECLARE
@totalDespesas FLOAT
,@totalDespesasAcomp FLOAT
,@resultado FLOAT
SET @totalDespesas = (SELECT SUM(valorReal) FROM dbo.contasRatear)
SET @totalDespesasAcomp = (SELECT SUM(valorReal) FROM dbo.contasRatear WHERE acompanhar = 'SIM')
SET @resultado = ROUND(((@totalDespesasAcomp / @totalDespesas) * 100),2)
SELECT @resultado as totalperc
Upon receiving the result value in ASP, error appears: "O_item_não_pode_ser_encontrado_na_coleção_correspondente_ao_nome_ou_ao_ordinal_solicitado."
ASP/HTML:
<%
sql = "EXEC despesasRatearBuscaPercentualDespesas;"
set bd = Conn.execute(sql)
%>
<th colspan="1" style="text-align:center" id="" class=""><%=bd("totalperc")%>%</th>
Can you help me? Thank you :)
It seems to me you’re not finding some column that you put in the past.
– Sam
Thank you, but the column is, 'totalperc'...
– Lucas Angelozzi Silva
The connection is open?
– Ronaldo Araújo Alves
Yes open connection.
– Lucas Angelozzi Silva
Any other trial works normally. Recovers the "Fields"... I believe the problem is in this my trial...
– Lucas Angelozzi Silva