David Penton posted a query a few weeks ago that could select a random record.
SELECT TOP 1 col FROM tbl ORDER BY NEWID() HTH, Andrew -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 25, 2002 8:29 AM To: ActiveServerPages Subject: RE: Random picture from a Database But how do I get a random pic from the remaining pics? -----Original Message----- From: Matthew Small [mailto:[EMAIL PROTECTED]] Sent: September 25, 2002 9:19 AM To: ActiveServerPages Subject: RE: Random picture from a Database Put a binary field in your table. If the field is set, don't use that picture. Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 25, 2002 9:14 AM To: ActiveServerPages Subject: Random picture from a Database I just want to show a random picture form all those in my database. I used to just get the number of pics in my DB, then geta RND # and then call that ID, but, because I Autonumber them, when a pic got deleted, I would sometimes get an error. So, how can I get a rnd Pic ID from a database that has say 20 pics, but 10 are set to NOT be shown....ideas? Tim --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --- You are currently subscribed to activeserverpages as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
