Results 1 to 7 of 7

Thread: AGGHH!

  1. #1
    8575 Guest

    Default AGGHH!

    As I loop through table. I reach group id. I response.write each record, I need to know when a record has a group id , if it does then response.write the records with that id TOGETHER, then group the next ones together and so forth.<BR>1) some records have group id some dont<BR>2) records can have many different ids<BR>

  2. #2
    al dawg Guest

    Default RE: AGGHH!

    In your sql statement:<BR><BR>select * from thetable group by groupid<BR><BR>I don&#039t know how well that works, but I saw it on<BR><BR>Good luck

  3. #3
    8575 Guest

    Default RE: AGGHH! (anyone else...)

    i dont want to open another connection or query the database again

  4. #4
    al dawg Guest

    Default RE: AGGHH! (anyone else...)

    why would you have to open the database again? that should be able to go right in your original sql statement.<BR>

  5. #5
    Join Date
    Dec 1969

    Default RE: AGGHH! (anyone else...)

    Just put the GROUP BY in your original select statement....<BR>then use <BR>if rsRecSet("groupID")&#060;&#062;"" then<BR>out the output<BR>end if<BR>????<BR>SteveF<BR>

  6. #6
    8575 Guest

    Default RE: AGGHH! (anyone else...)

    I need all the records to be dispalyed.<BR>Some records have a groupid, which tell if it is a part of a group, not all have them, and they can be different.<BR>IF I group, by what happens to the records that are not apart of a group?<BR>And, I need to know when a group changes so I can add a break or new table.

  7. #7
    as3 Guest

    Default RE: AGGHH! (anyone else...)

    Add an ORDER BY groupid in your sql.<BR>Then, assuming you have numeric groupid&#039s, you can then compare recordset.groupid value vs last value (remember to store it in a tmpvar) and if it&#039s different, end your table and start a new one, change the TD bgcolor or add a group heading. All like groups should be together, including records without a groupid.

Posting Permissions

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