P
PeterL
Hi,
the enclosed code loops through a recordset for time and date. and printing out
name and volym if certan conditions are met.
<%
dat = ""
tp = ""
vt = 0
et = 0
vd = 0
de = 0
Do While Not rs1.EOF
If dat <> CDate(rs1("Dag")) then
If tp <> CDate(rs1("tidpunkt")) then
if not tp = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right >"
Response.Write "<B><U>Givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right>"
Response.Write "<B><U>Energi</U></B></TD></TD>"
Response.Write "<TD>" & et & "</TD></TR>"
end if
If not dat = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right >"
Response.Write "<B><U>Under dygnet givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right>"
Response.Write "<B><U>Energi givet under dygnet</U></B></TD></TD>"
Response.Write "<TD>" & de & "</TD></TR>"
end if
dat = CDate(rs1("Dag"))
vt = cint(rs1("Volym"))
et = cint(rs1("Energi"))
tp = CDate(rs1("tidpunkt"))
Response.Write "<TR><TD>" & CDate(rs1("Dag"))& "</TD>"
Response.Write "<TD>" & CDate(rs1("tidpunkt"))& "</TD>"
Response.Write "<TD>" & rs1("FluidNamn") & "</TD>"
Response.Write "<TD>" & rs1("Volym") & "</TD></TR>"
Else
vt = vt + cint(rs1("Volym"))
et = et + cint(rs1("Energi"))
Response.Write "<TR><TD> </TD>"
Response.Write"<TD> </TD>"
Response.Write "<TD>" & rs1("FluidNamn") & "</TD>"
Response.Write "<TD>" & rs1("Volym") & "</TD></TR>"
End If
Else
vd = vt + vt
de = de + de
rs1.MoveNext
Loop
if not tp = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right >"
Response.Write "<B><U>Givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right>"
Response.Write "<B><U>Energi</U></B></TD></TD>"
Response.Write "<TD>" & et & "</TD></TR>"
end if
If not dat = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right >"
Response.Write "<B><U>Under dygnet givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right>"
Response.Write "<B><U>Energi givet under dygnet</U></B></TD></TD>"
Response.Write "<TD>" & de & "</TD></TR>"
end if
vbalans.Close
Set vbalans = Nothing
%>
I keeping geting:
Microsoft VBScript compilation error '800a040e'
'loop' without 'do'
/vatskebalans/visa_rapporten102.asp, line 87
Loop
^
Please help me out
Yours
Peter
the enclosed code loops through a recordset for time and date. and printing out
name and volym if certan conditions are met.
<%
dat = ""
tp = ""
vt = 0
et = 0
vd = 0
de = 0
Do While Not rs1.EOF
If dat <> CDate(rs1("Dag")) then
If tp <> CDate(rs1("tidpunkt")) then
if not tp = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right >"
Response.Write "<B><U>Givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right>"
Response.Write "<B><U>Energi</U></B></TD></TD>"
Response.Write "<TD>" & et & "</TD></TR>"
end if
If not dat = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right >"
Response.Write "<B><U>Under dygnet givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right>"
Response.Write "<B><U>Energi givet under dygnet</U></B></TD></TD>"
Response.Write "<TD>" & de & "</TD></TR>"
end if
dat = CDate(rs1("Dag"))
vt = cint(rs1("Volym"))
et = cint(rs1("Energi"))
tp = CDate(rs1("tidpunkt"))
Response.Write "<TR><TD>" & CDate(rs1("Dag"))& "</TD>"
Response.Write "<TD>" & CDate(rs1("tidpunkt"))& "</TD>"
Response.Write "<TD>" & rs1("FluidNamn") & "</TD>"
Response.Write "<TD>" & rs1("Volym") & "</TD></TR>"
Else
vt = vt + cint(rs1("Volym"))
et = et + cint(rs1("Energi"))
Response.Write "<TR><TD> </TD>"
Response.Write"<TD> </TD>"
Response.Write "<TD>" & rs1("FluidNamn") & "</TD>"
Response.Write "<TD>" & rs1("Volym") & "</TD></TR>"
End If
Else
vd = vt + vt
de = de + de
rs1.MoveNext
Loop
if not tp = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right >"
Response.Write "<B><U>Givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right>"
Response.Write "<B><U>Energi</U></B></TD></TD>"
Response.Write "<TD>" & et & "</TD></TR>"
end if
If not dat = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right >"
Response.Write "<B><U>Under dygnet givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right>"
Response.Write "<B><U>Energi givet under dygnet</U></B></TD></TD>"
Response.Write "<TD>" & de & "</TD></TR>"
end if
vbalans.Close
Set vbalans = Nothing
%>
I keeping geting:
Microsoft VBScript compilation error '800a040e'
'loop' without 'do'
/vatskebalans/visa_rapporten102.asp, line 87
Loop
^
Please help me out
Yours
Peter