dawilis
11-08-2003, 11:57 AM
I know Im giving this forum a workout at the moment thanks for your help
I am trying to get the total records based on this statement, it works because Im not drawing out much info, however I do need to use the last part, the filter on the month, thats not working, as a matter of fact its just ignoring it, as if its not there. any ideas
SQL= "SELECT count(*) as id From NMContact WHERE Age ='"&age&"' AND PolicyId ="&PolicyId&" AND Month ='"&months&"'"
have included below code in its entirity
do while i <= loopcount
' Now loop through the Policies
x = 1
do While x <= policyidmax
age = ageis(i)
amount = 0
policyid = x
SQL1= "SELECT * FROM Health WHERE IDH ="& policyId
rs1.open sql1,con
SQL= "SELECT count(*) as id From NMContact WHERE Age ='"&age&"' AND PolicyId ="&PolicyId&" AND Month ='"&months&"'"
rs2.open SQL,con
' if user does not want the zero entries
if rs2("id") = 0 and noz = 1 Then
x = x + 1
counter = counter + 1
rs1.close
rs2.close
exit do
end if
amount = rs2("id")
%>
<%If (counter Mod 2) Then%>
<tr bgcolor="<%=bgcolour2%>">
<%ELSE%>
<tr bgcolor="<%=bgcolour1%>">
<%End If%>
<td width="33%" height="25"><div align="center"><%=age%><BR>
</div></td>
<td width="33%"><div align="center"><%=rs1("HealthType")%><BR>
</div></td>
<td width="26%"><div align="center"><%=amount%><BR>
</div></td>
<td width="8%"><a href="print.asp?mode=1&msg=1&loop=1&no=<%=noz%>" class="hlink">Print</a> </td>
</tr>
<%
x = x + 1
counter = counter + 1
rs1.close
rs2.close
loop
i = i + 1
' rs.close
'rs1.close
loop
end if
%>
I am trying to get the total records based on this statement, it works because Im not drawing out much info, however I do need to use the last part, the filter on the month, thats not working, as a matter of fact its just ignoring it, as if its not there. any ideas
SQL= "SELECT count(*) as id From NMContact WHERE Age ='"&age&"' AND PolicyId ="&PolicyId&" AND Month ='"&months&"'"
have included below code in its entirity
do while i <= loopcount
' Now loop through the Policies
x = 1
do While x <= policyidmax
age = ageis(i)
amount = 0
policyid = x
SQL1= "SELECT * FROM Health WHERE IDH ="& policyId
rs1.open sql1,con
SQL= "SELECT count(*) as id From NMContact WHERE Age ='"&age&"' AND PolicyId ="&PolicyId&" AND Month ='"&months&"'"
rs2.open SQL,con
' if user does not want the zero entries
if rs2("id") = 0 and noz = 1 Then
x = x + 1
counter = counter + 1
rs1.close
rs2.close
exit do
end if
amount = rs2("id")
%>
<%If (counter Mod 2) Then%>
<tr bgcolor="<%=bgcolour2%>">
<%ELSE%>
<tr bgcolor="<%=bgcolour1%>">
<%End If%>
<td width="33%" height="25"><div align="center"><%=age%><BR>
</div></td>
<td width="33%"><div align="center"><%=rs1("HealthType")%><BR>
</div></td>
<td width="26%"><div align="center"><%=amount%><BR>
</div></td>
<td width="8%"><a href="print.asp?mode=1&msg=1&loop=1&no=<%=noz%>" class="hlink">Print</a> </td>
</tr>
<%
x = x + 1
counter = counter + 1
rs1.close
rs2.close
loop
i = i + 1
' rs.close
'rs1.close
loop
end if
%>