Grouping Records for display

Results 1 to 2 of 2

Thread: Grouping Records for display

  1. #1
    Tony Gilbert Guest

    Default Grouping Records for display

    Is there a clean, single statement which will allow a select and display with "group by" in Access? At the moment, I am calling the distinct categories from the table first, then creating a call to the sub-categories by category. This is very messy. I cannot find a syntax for "group by" or "break on". What I want is to display multiple records under city headings, where "city" is one of the fields in each record, and there may be 1 or 100 records for each city.

  2. #2
    Franco Guest

    Default RE: Grouping Records for display

    Tony<BR><BR>If I understand your problem, then a double Do Loop could be useful.<BR><BR>Do Until MyRs.EOF<BR> City=MyRs("City")<BR> Do Until MyRs("City") &#060;&#062; City<BR> Response.Write MyRs("City") & ": " & MyRs("Town")<BR> MyRs.MoveNext<BR> Loop<BR>Loop<BR><BR>That might need tweaking but I think it&#039ll work...<BR><BR>Franco<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts