You don't have .value on your teachDept1 field references. That could be a problem.
You are also using teachdept1 and teachDept1 inconsistently. I doubt that the field name is case-sensitive, but can't say categorically. Dave S ----- Original Message ----- From: acschnabel To: [email protected] Sent: Saturday, July 30, 2005 5:29 AM Subject: [ASP] Assistance with Records display I'm trying to display my staff members by department, not have to repeat the department name in the table. Currently, the data appears as follows Dept1 staff member dept1 staff member dept 2 staff member dept 2 staff member I would like them to appear as follows: dept1 staff member staff member dept2 staff member staff member Here is the code... <% Dim DeptName Set rs = Server.CreateObject("ADODB.Recordset") sSQL = "Select * from staff order by teachDept1" set rs = conn.Execute(sSQL) %> <table> <% Do While Not rs.EOF If DeptName <> rs.fields("teachDept1") then %> <tr><td colspan=2> <%= rs.fields("teachdept1") %> </td></tr> <% end if %> <tr><td><%= rs.fields("teachTitle").value %> <%= rs.Fields ("teachFN").value %> <%= rs.fields("teachLN").value %></td><td><a href=<%=rs.fields("teachWeb").value%>>Home Page</a></td></tr> <% DeptName=rs.fields("teachDept1") rs.MoveNext Loop rs.Close Response.Write("</table>") Set rs = Nothing Set sSql = Nothing Set DeptName = Nothing %> Thanks in advance for your help. --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- ------------------------------------------------------------------------------ YAHOO! GROUPS LINKS a.. Visit your group "active-server-pages" on the web. b.. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ------------------------------------------------------------------------------ [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h83fgf7/M=362329.6886308.7839368.1510227/D=groups/S=1705115381:TM/Y=YAHOO/EXP=1122689093/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992 ">Fair play? Video games influencing politics. Click and talk back!</a>.</font> --------------------------------------------------------------------~-> --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
