Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/04/2005, 07:22
Cony28
 
Fecha de Ingreso: abril-2005
Mensajes: 73
Antigüedad: 20 años, 2 meses
Puntos: 0
Calculo promedio

quiero calcular el promedio de los alumnos, para eso tengo la tabla2 con los siguientes campos, RUT,NOMBRE,NOTA y el siguiente codigo:

<%
Dim dbBase,strSQL1,objRS1
Set dbBase=Server.CreateObject("ADODB.Connection")
dbBase.Open("prueba")
strSQL1 = "SELECT Rut, Nombre, Nota FROM tabla2"
Set objRS1 = dbBase.Execute(strSQL1)

%>
<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR><TD>&nbsp;Nombre</TD><TD>&nbsp;Apellidos&nbsp;</TD><TD>&nbsp;Nota&nbsp;</TD></TR>
<%

while (not objRS1.Eof)
Response.Write("<tr><td>&nbsp;" & objRS1("Rut") & "</td><td>&nbsp;" & objRS1("Nombre") & "&nbsp;</td><td>&nbsp;" & objRS1("Nota") & "&nbsp;</td></tr>")
objRS1.MoveNext
wend

dbBase.Close
set objRS1 = nothing
set dbBase = nothing

%>
El cual me muestra en pantalla el listado de rut, nombre, nota, pero a esa nota yo quiero calcularle el promedio y luego lanzarla en pantalla, ¿como se calcula con un select o una funcion?
Si alguien me puede ayudar...Gracias.