ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 4th, 2000, 12:01 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Returning Random 10 Records form a SQL Table

<i><b>Originally posted by : Chris Bond (chris@praceng.com)</b></i><br />Hi,<br /><br />Whats the best way to return a random 10 records form the sql table.<br /><br />Thanks,<br />Chirs

Reply With Quote
  #2  
Old April 13th, 2000, 01:24 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Barry B</b></i><br /><br />I don't know about "best" but I have used the following.<br /><br />Call recordset<br />Get the number of records in the record set<br />Divide that number by the number of random records you want to return. Go to the next lower number. Generate a random number based on the the results of your divide. Us this as your starting point in the recordset and jump the number of records (the results of the divide) to get the next.<br /><br />Alternately<br /> Get the number of records. Divide by 2. Get random number based on the divided results. Start there and jump (pick a number) choosing your 10 records. While not completely random it will give you the results you want.<br /><br />------------<br />Chris Bond at 4/4/2000 10:01:18 AM<br /><br />Hi,<br /><br />Whats the best way to return a random 10 records form the sql table.<br /><br />Thanks,<br />Chirs

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Returning Random 10 Records form a SQL Table


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT