Forums

This topic is locked

help creating recordset.

Posted 22 Jun 2004 00:37:35
1
has voted
22 Jun 2004 00:37:35 Dan Berdusco posted:
Hi, I have a question regarding a fairly complicated recordset question. I will attempt to explain it the best way possible. I Have 2 tables setup that I want to use to insert events. Each event is classified under a specific category:

tblEventCat - This table includes 18 records used as event categories
-------------
eventCatID
eventCatName



tblEvents - This table lists the events
-------------
eventID
eventCatID
eventTitle
eventDate
eventDescription



What I would like to do, is display 2 random records from each category in a list on a page. Something like this:

<b>Arts and Crafts</b> (eventCatName)
-Art Festival - June 24, 2004 (eventTitle - eventDate)
-Book Fair - June 29, 2004

<b>Business</b>
-Business Seminar- June 19, 2004
-Planning meeting - June 30, 2004

<b>Children</b>
-Fred Penner concert - June 20, 2004
-Swimming at the YMCA - July 4, 2004

This would continue for all 18 categories. Each of the 2 listings for each category should be random if possible.


I realize that I could probably do this by creating 18 seperate recordsets, but this would slow down the page dramatically. I am looking for a way to create this the best way with as few recordsets as possible.

Any help would be appreciated. Thanks in advance.

Reply to this topic