error '800a040e'

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>&nbsp;</TD>"
Response.Write"<TD>&nbsp;</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
 
P

PeterL

Thanks 4 your answer and help
Now that it works I se more problems - I hope you can help me with
this even though the page is in swedish
1)Not al post shows i.e if hou visit the page
http://www12.brinkster.com/vatskebalans/count.asp and mark "Elvansson"
then you see
a) for 040321 there is 5 posts for time 00:00
b)for 040603 there´s in the database 2 posts 14:42, 1 post kl 00:00
and 1 post kl 14:20

c) "Energi givet under dygnet" = de in my code doesn´t give the right
answer -something wrong with my formula

2) for the others on that page I keep getting error:
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'CDate'
/vatskebalans/visa_rapporten102.asp, line 45

and line 45 = If tp <> CDate(rs1("tidpunkt")) then
please help me out with my problems

Thx in advance
/Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top