SELECT TOP 1  ...
FROM ...
WHERE ...
ORDER BY rand()

That basic concept should work on most any DB, though you may need to
tweak it slightly to get it to behave correctly

cheers,
barneyb

On Tue, 26 Oct 2004 15:46:49 -0400, Claremont, Timothy
<[EMAIL PROTECTED]> wrote:
> I have a request to return a set number of random records that meet
> certain criteria. In other words, based on input from a form, I want x
> (anywhere from 5 to 100) random records that fall between StartDate and
> EndDate and belong to Center x.
> 
> How do I accomplish the random sampling?
> 
> TIA
> Tim
> 
-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/blog/

I currently have 0 GMail invites for the taking

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=36

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182665
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to