
24/02/2004, 13:54
|
| | Fecha de Ingreso: enero-2002 Ubicación: Bogotá
Mensajes: 438
Antigüedad: 23 años, 4 meses Puntos: 2 | |
Error de sintaxis Hola tengo que hacer un ciclo para que por cada persona me saca unos datos y unas graficas el problema esta es una función que uso y este es el mensaje que me aparece Error de compilación de Microsoft VBScript error '800a03ea'
Error de sintaxis
/proyectos/Tiempo establecido para entrega.vbs, line 47
sub BarChart2(data2, labels2, title2, axislabel2)
^
mis lineas de codigo son:
<%set resp=server.CreateObject("ADODB.recordset")
sqlresp="select p.codresp, a.nombre from propuesta p, administracion a order by p.codresp"
set resp=conn.execute(sqlresp)
while not resp.eof
Set rsc2=conn.execute(sqlc2)%>
<!-- #include file="Tiempo establecido para entrega.vbs" -->
<%resp.movenext
wend %>
y el archivo vbs contiene:
<%%>
<%'*********************************************** *******************
'AQUI EMPIEZA LA INTERACCIÓN PARA MAS DE MAS DE UNA PERSONA"
set Rs2=server.CreateObject ("ADODB.Recordset")
set Rsc2=server.CreateObject ("ADODB.Recordset")
set Rstip2=server.CreateObject ("ADODB.Recordset")
'rs.CursorType=1
RS2.CursorLocation = 3
'conn.open
'rstip.open sqltip,conn,3,3
sw=0
if request("item")<>"0" and request("item")<>"" then
sql2="select count(to_days(p.fechacierre)-to_days(p.fechaentrega)) as consecutivo,to_days(p.fechacierre)-to_days(p.fechaentrega) as fechatot, a.nombre from propuesta p,administracion a where p.codresp=a.cod and p.codresp=1098 and not fechaentrega='0000-00-00 00:00:00' and not fechacierre='0000-00-00 00:00:00' and (to_days(fechacierre)-to_days(fechaentrega)) "+request("item")+" "+request("dias")+" and (codestado='Entregado' or codestado='Adjudicado') group by fechatot"
sqlc2="select count(to_days(p.fechacierre)-to_days(p.fechaentrega)) as consecutivo from propuesta p,administracion a where p.codresp=a.cod and p.codresp=1098 and not fechaentrega='0000-00-00 00:00:00' and not fechacierre='0000-00-00 00:00:00' and (to_days(fechacierre)-to_days(fechaentrega)) "+request("item")+" "+request("dias")+" and (codestado='Entregado' or codestado='Adjudicado')"
sw=1
else
sql2="select count(to_days(p.fechacierre)-to_days(p.fechaentrega)) as consecutivo,to_days(p.fechacierre)-to_days(p.fechaentrega) as fechatot, a.nombre from propuesta p, administracion a where p.codresp=a.cod and p.codresp=1098 and not fechaentrega='0000-00-00 00:00:00' and not fechacierre='0000-00-00 00:00:00' and (codestado='Entregado' or codestado='Adjudicado') group by fechatot"
sqlc2="select count(to_days(p.fechacierre)-to_days(p.fechaentrega)) as consecutivo from propuesta p, administracion a where p.codresp=a.cod and p.codresp="&resp("p.codresp")&" and not fechaentrega='0000-00-00 00:00:00' and not fechacierre='0000-00-00 00:00:00' and (codestado='Entregado' or codestado='Adjudicado')"
end if
if cstr(request("finicio"))<>"" and cstr(request("ffinal"))<>"" then
if sw=1 then
sql2="select count(to_days(p.fechacierre)-to_days(p.fechaentrega)) as consecutivo,to_days(p.fechacierre)-to_days(p.fechaentrega) as fechatot,a.nombre from propuesta p, administracion a where p.codresp=a.cod and p.codresp=1098 and not p.fechaentrega='0000-00-00 00:00:00' and not p.fechacierre='0000-00-00 00:00:00' and (p.codestado='Entregado' or p.codestado='Adjudicado') and p.fechaentrega between '"+request("finicio")+"' and '"+request("ffinal")+"' and (to_days(p.fechacierre)-to_days(p.fechaentrega)) "+request("item")+request("dias")+" group by fechatot"
sqlc2="select count(to_days(p.fechacierre)-to_days(p.fechaentrega)) as consecutivo from propuesta p, administracion a where p.codresp=a.cod and p.codresp=1098 and not p.fechaentrega='0000-00-00 00:00:00' and not p.fechacierre='0000-00-00 00:00:00' and (p.codestado='Entregado' or p.codestado='Adjudicado') and p.fechaentrega between '"+request("finicio")+"' and '"+request("ffinal")+"' and (to_days(p.fechacierre)-to_days(p.fechaentrega)) "+request("item")+request("dias")+""
else
sql2="select count(to_days(p.fechacierre)-to_days(p.fechaentrega)) as consecutivo,to_days(p.fechacierre)-to_days(p.fechaentrega) as fechatot, a.nombre from propuesta p, administracion a where p.codresp=a.cod and p.codresp=1098 and not p.fechaentrega='0000-00-00 00:00:00' and not p.fechacierre='0000-00-00 00:00:00' and (p.codestado='Entregado' or p.codestado='Adjudicado') and p.fechaentrega between '"+request("finicio")+"' and '"+request("ffinal")+"' and fecharecibo between '"+request("finicio")+"' and '"+request("ffinal")+"' group by fechatot"
sqlc2="select count(to_days(p.fechacierre)-to_days(p.fechaentrega)) as consecutivo from propuesta p, administracion a where p.codresp=a.cod and p.codresp=1098 and not p.fechaentrega='0000-00-00 00:00:00' and not p.fechacierre='0000-00-00 00:00:00' and (p.codestado='Entregado' or p.codestado='Adjudicado') and p.fechaentrega between '"+request("finicio")+"' and '"+request("ffinal")+"' and fecharecibo between '"+request("finicio")+"' and '"+request("ffinal")+"'"
end if
end if
response.Write(sql2)
'response.Write("el valor de rsc2 es "+rs2("nombre")+"<br>")
%>
<br>
<%rs2.open sql2,conn,3,3
resp=rs2("nombre")
if rs2.eof then
response.Write("<font size=1 face='MS Sans Serif'><strong>No hay registros para este query</strong></font>")
response.end
end if
Const graphHeight2 = 200
Const graphWidth2 =50
Const barImage2 = "images\color"
sub BarChart2(data2, labels2, title2, axislabel2)
'PARA HACER EL CICLO PARA LOS DIFERENTES RESPONSABLES
'PARA HACER LA SEGUNDA TABLA CON LOS DATOS
response.Write("<br><br>")
Response.Write("<table align=center width=30 border=1 cellspacing=0 STYLE=font: bold 10px MS Sans Serif;>")
response.Write("<tr>")
Response.Write("<td colspan=4><div align=center><font size=1 face='MS Sans Serif'><strong>"&resp&"</strong></font></div></td>"&chr(13))
response.write("</tr>")
Response.Write("<tr>" & chr(13))
Response.Write("<td> </td>"&chr(13))
Response.Write("<td nowrap><font size=1 face='MS Sans Serif'><strong>Cant. Propuestas</strong></font></td>" & chr(13))
Response.Write("<td><font size=1 face='MS Sans Serif'><strong>No. Días</strong></font></td>"&chr(13))
Response.Write("<td><font size=1 face='MS Sans Serif'><strong><center>%</center></strong></font></td>"&chr(13))
Response.Write("</tr>" & chr(13))
total=0
i2=0
for i=LBound(data2) to UBound(data2)
i2=i2+1
if i2=13 then
i2=0
end if
if i<>rs2.recordcount then
Response.Write("<tr>" & chr(13))
Response.Write(" <td> <IMG SRC=""" & barImage & cstr(i2+1) &".gif"& """ ></td> "&chr(13))
Response.Write("<td nowrap><font size=1 face='MS Sans Serif'><strong>"&labels2(i)&"</strong></font></td>" & chr(13))
Response.Write("<td><div align=center><font size=1 face='MS Sans Serif'><strong>"&data2(i)&"</strong></font></div></td>"&chr(13))
'response.Write("el valor de rs es "+cstr(rs("consecutivo"))+"<br>")
Response.Write("<td><div align=center><font size=1 face='MS Sans Serif'><strong>"&round((100*labels2(i))/cint(rsc2("consecutivo")),2)&"</strong></font></div></td>"&chr(13))
Response.Write("</tr>" & chr(13))
total=cint(data2(i))+total
else
' Response.Write("<tr>" & chr(13))
' Response.Write(" <td> </td> "&chr(13))
' Response.Write("<td nowrap><font size=1 face='MS Sans Serif'><strong>Total</strong></font></td>" & chr(13))
' Response.Write("<td><div align=center><font size=1 face='MS Sans Serif'><strong>"&total&"</strong></font></div></td>"&chr(13))
' Response.Write("</tr>" & chr(13))
'i2=i2+1
end if
next
response.Write("<tr>")
Response.Write("<td colspan=4><div align=center><font size=1 face='MS Sans Serif'><strong>Total: "&rsc2("consecutivo")&"</strong></font></div></td>"&chr(13))
Response.Write("</tr></table><br><br>" & chr(13))
'************************************************
'Print heading
Response.Write("<TABLE ALIGN=CENTER CELLSPACING=0 CELLPADDING=1 BORDER=0 STYLE='font: bold 12px 'MS Sans Serif';'")
Response.Write(" WIDTH=" & graphWidth & ">" & chr(13))
Response.Write("<TR><TH COLSPAN=" & UBound(data2) - LBound(data2) + 2)
Response.Write(">")
Response.Write("<FONT SIZE=+2>" & title2 & "</FONT></TH></TR>")
Response.Write("<TR><TD VALIGN=TOP ALIGN=RIGHT>" & chr(13))
'Find the highest value
Dim hi, low
hi = data2(LBound(data2))
Dim i
for i = LBound(data2) to UBound(data2)
if cint(data2(i)) > cint(hi) then
hi = data2(i)
end if
next
'Print out the highest value at the top of the chart
Response.Write(hi & "</TD>")
Dim widthpercent
widthpercent = CInt((1 / (UBound(data2) - LBound(data2) + 1)) * 100)
i2=0
For i = LBound(data2) to UBound(data2)
i2=i2+1
if i2=13 then
i2=0
end if
if i<>rs2.recordcount then
Response.Write(" <TD VALIGN=BOTTOM ROWSPAN=2 WIDTH=") |