I'm new at this and still get really stuck so I've probably overworked this till I can't see how simple it is. I just need a report that shows which churches are entering monthly reports. Example:
Desired Report:
Church Jan feb mar april etc.
churchA X N Y N
churchB Y Y Y Y
churchC N Y Y N
OK here's what I have. The first month works perfect, but the second month is wrong and I don't know how to fix for records not entered yet for months August-December.
<th class=td1 colspan="2"> Church </th>
<th class=td1> Jan </th>
<th class=td1> Feb </th>
<th class=td1> Mar </th>
<th class=td1> Apr </th>
<th class=td1> May </th>
<th class=td1> Jun </th>
<th class=td1> Jul </th>
<th class=td1> Aug </th>
<th class=td1> Sep </th>
<th class=td1> Oct </th>
<th class=td1> Nov </th>
<th class=td1> Dec </th>
</tr>
<%
strSQL="select mem.churchid, ch.churches_name FROM members mem LEFT OUTER JOIN ochurches ch ON ch.churches_id=mem.churchid and mem.year=2011 WHERE mem.district=21 ORDER BY ch.churches_name_full"
Set rs = Conn.Execute(strSQL)
if not rs.eof then
i=0
do while not rs.eof
i=i+1
churchid=rs("churchid")
church=rs("churches_name")
strSQL="Select ev.month, ev.report_date from evandata ev where ev.churchid="& churchid &" and ev.year=2011 and ev.month IS NOT NULL ORDER BY ev.month"
Set rs1 = Conn.Execute(strSQL)
If not rs1.eof Then
rmonth=rs1("month")
rdate=rs1("report_date")
If rmonth = 1 Then
jan=True
Else jan=False
End If
If jan=True Then
jan=(" Y ")
Else
jan=(" N ")
End If
If rmonth = 2 Then
febrec=True
Else febrec=False
End If
If febrec=True Then
febrec=(" Y ")
Else
febrec=(" N ")
End If
response.write "<td colspan=2 class=td3>" & church & "</td><td align=center>" & janrec & "</td><td align=center>" & febrec & "</td></tr>"
End If
rs1.Close
Set rs1=Nothing
rs.movenext
loop
%>
<%End If
%>
<%
rs.close
set rs=nothing
%>
</td></tr></tr></table>