I am pulling a numeric field (rtTot) from a SQL table in a query. In the process of a loop on my output page, I am attempting to compare what the value was during the preceding loop to what it is during the current loop, and create output based on which is larger. However, I get the error:
"Microsoft VBScript runtime error '800a000d'
Type mismatch
/Quality_Documents/AVLdet.asp, line 118 "
Below is the code; line 118 is the line which i have marked here with >>>>>
[tt]
rtCount = 0
rtTot = 0
set rstemp= Con.Execute(rateSQL)
response.write("<TR><TD colspan=2><CENTER><TABLE cellpadding=2>")
DO UNTIL rstemp.eof
NewTot = rstemp(5)
>>>>>If rtCount = 0 Then rtDiff = "" Else If rtTot > NewTot Then rtDiff = "(+)</CENTER></TD></TR>" Else If rtTot < NewTot Then rtDiff = "(-)</CENTER></TD></TR>" Else rtDiff = "(.)</CENTER></TD></TR>" End If
response.write(rtDiff)
rtStart = rstemp(0)
rtEnd = rstemp(1)
rtOD = rstemp(2)
rtQP = rstemp(3)
rtR = rstemp(4)
rtTot = rstemp(5)
response.write("<TR><TD>" & rtStart & " - " & rtEnd & "</TD><TD><CENTER>" & rtOD & "</CENTER></TD><TD><CENTER>" & rtQP & "</CENTER></TD><TD><CENTER>" & rtR & "</CENTER></TD><TD><CENTER>" & rtTot & "</CENTER></TD><TD><CENTER>")
rtCount = rtCount +1
rstemp.movenext
Loop
[/tt]
I have tried removing the section of the if statement that looks at rtCount, with no effect. I also temporarily put in a statement having it output the values of rtTot and NewTot, so that I could verify that values did exist for both, which was true.
Based on the error, I would believe that I am trying to do a mathematical comparison to values which are not numeric, yet I have confirmed that they are numeric fields in the SQL data. Can anyone help me determine where to look next for my error?
Cheryl dc Kern
"Microsoft VBScript runtime error '800a000d'
Type mismatch
/Quality_Documents/AVLdet.asp, line 118 "
Below is the code; line 118 is the line which i have marked here with >>>>>
[tt]
rtCount = 0
rtTot = 0
set rstemp= Con.Execute(rateSQL)
response.write("<TR><TD colspan=2><CENTER><TABLE cellpadding=2>")
DO UNTIL rstemp.eof
NewTot = rstemp(5)
>>>>>If rtCount = 0 Then rtDiff = "" Else If rtTot > NewTot Then rtDiff = "(+)</CENTER></TD></TR>" Else If rtTot < NewTot Then rtDiff = "(-)</CENTER></TD></TR>" Else rtDiff = "(.)</CENTER></TD></TR>" End If
response.write(rtDiff)
rtStart = rstemp(0)
rtEnd = rstemp(1)
rtOD = rstemp(2)
rtQP = rstemp(3)
rtR = rstemp(4)
rtTot = rstemp(5)
response.write("<TR><TD>" & rtStart & " - " & rtEnd & "</TD><TD><CENTER>" & rtOD & "</CENTER></TD><TD><CENTER>" & rtQP & "</CENTER></TD><TD><CENTER>" & rtR & "</CENTER></TD><TD><CENTER>" & rtTot & "</CENTER></TD><TD><CENTER>")
rtCount = rtCount +1
rstemp.movenext
Loop
[/tt]
I have tried removing the section of the if statement that looks at rtCount, with no effect. I also temporarily put in a statement having it output the values of rtTot and NewTot, so that I could verify that values did exist for both, which was true.
Based on the error, I would believe that I am trying to do a mathematical comparison to values which are not numeric, yet I have confirmed that they are numeric fields in the SQL data. Can anyone help me determine where to look next for my error?
Cheryl dc Kern