PDA

View Full Version : Grouping


kuchiv
01-08-2003, 03:34 AM
'both dt and tempDt are recordsets
The query used for dt-recordset is
select review_item.revrec_itemcode, customer.cust_name, customer.cust_contact_name, customer.cust_phone, customer.cust_fax, review_item.revrec_type from customer, review_item where customer.cust_code = review_item.revrec_itemcode order by customer.cust_code

if not dt.EOF then
str = dt("revrec_itemcode")
%>
<td class="evenrow" COLSPAN=2 width="5%">
<%=start%>
<td class="evenrow" colspan=4 width="10%" align="center"><a HREF="QCustomerDetail.asp?<%=ExtraStr%>&ccode=<%=common.ConvertSpecialCharacters(dt("revrec_itemcode"))%>"><%=dt("revrec_itemcode")%></a></td>
<td class="evenrow" colspan=4 width="10%" align="center"><%=dt("cust_name")%></td>
<td class="evenrow" colspan=4 width="10%" align="center"><%=dt("cust_contact_name")%></td>
<td class="evenrow" colspan=2 width="10%" align="center"><%=dt("cust_phone")%></td>
<td class="evenrow" colspan=2 width="10%" align="center"><%=dt("cust_fax")%></td>
<td class="evenrow" align="center" colspan=2 width="10%" align="center"><center><input type="checkbox" id="chkd" name="chkd" value="<%=common.ConvertSpecialCharacters(sid)%>"></center></td>
<%
set tempDt = conn.Execute ("select revrec_type from review_item, customer where customer.cust_code=review_item.revrec_itemcode group by revrec_type;")
while not tempDt.EOF
Response.Write "in while"
%>
<td class="evenrow" colspan=2 width="5%" align="center"><a href="QCustomerCalls.asp"><%=tempDt("revrec_type")%><%=start%></a><%start = start + 1%>
<%
tempdt.MoveNext
wend
%>

the output I am looking for is,
for each instance of the company, all the issues or the complaints in the database should be displayed in the report.
but with this logic, I am able to print only the first company 1st complaint. whatz wrong with this code?.