Hola lo dejo asi y me sigue dando error:
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'cint'
Código ASP:
Ver original'SELECT p.peso,p.tubo,p.fecha, o.linea FROM pesos as p, optimas as o where o.codigo = p.codOptima and o.linea = 'L02N' AND p.fecha Between '2010-05-11 09:42:34.000' AND '2010-05-11 09:42:39.000'
SET conexion2=Server.CreateObject("ADODB.Connection")
conexion2.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MAPLE01;UID=sa;PWD=messrv;DATABASE=wasp "
SET registros2=Server.CreateObject("ADODB.RecordSet")
registros2.open"SELECT AVG(PESO)as peso from pesos where fecha Between '"&calendar1&"' AND '"&calendar2&"'AND hora='"&hora&"' AND codoptima='"&codoptima&"'",conexion2
do while not registros2.eof
if registros2.fields("peso")="" then
c=0
else
c=cint(registros2.fields("peso"))
end if
'b=(a-c)/a
b=(c-a)/a
response.write("Promedio: <b>"®istros2.fields("peso")&"</b><br>")