Uso questo codice per sommare la quantità (campo QT) di tutti i records dove il campo (idEntrata) è uguale a "XXX"
ma se nel database non c'è alcun record con un campo idEntrata = "xxx" come faccio impostare tot2 = 0
Non ci riesco!![]()
<%
set rs=objConn.execute ("Select SUM(qt) as totale2 from uscite Where idEntrata = 'xxx'")
tot2 = rs("totale2")
if tot2 <> 0 then
totaleQTuscita = formatNumber(tot2,2)
else
totaleQTuscita = rs("totale2")
end if
Session("QTuscita") = totaleQTuscita
%>

Rispondi quotando
