Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Random select

Author  Topic 

MattieBala69
Starting Member

30 Posts

Posted - 2005-04-21 : 13:14:19
Hey ,
I need to pick randomly 265 rows of data from a table . If some one could help me out would be great. I am new to Access.
Thank you,
Mattie

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2005-04-21 : 13:16:41
Please do not cross post http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=48741

Jim
Users <> Logic
Go to Top of Page

MattieBala69
Starting Member

30 Posts

Posted - 2005-04-21 : 13:19:54
I am sorry i did not realize we had Access. thats why i posted there at first and Brett told me that we have Access. Thats why i posted it here.
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2005-04-21 : 13:24:28
He also asked you a question.


quote:
OK< what's the syntax...help doesn't say how



Jim
Users <> Logic
Go to Top of Page

bferriter
Starting Member

34 Posts

Posted - 2005-04-21 : 13:46:02
do you want to select the top of a table randomly, or random records all over the table?
Go to Top of Page

MattieBala69
Starting Member

30 Posts

Posted - 2005-04-21 : 15:11:17
Random records all over the table please

this was the query i got from my boss.

SELECT [Corrsep Del to select and add to stat sample Revision I].Channel, [Corrsep Del to select and add to stat sample Revision I].Delegated, [Corrsep Del to select and add to stat sample Revision I].ProductCode, [Corrsep Del to select and add to stat sample Revision I].LoanNumber, [Corrsep Del to select and add to stat sample Revision I].[Select]
FROM [Corrsep Del to select and add to stat sample Revision I]
GROUP BY [Corrsep Del to select and add to stat sample Revision I].Channel, [Corrsep Del to select and add to stat sample Revision I].Delegated, [Corrsep Del to select and add to stat sample Revision I].ProductCode, [Corrsep Del to select and add to stat sample Revision I].LoanNumber, [Corrsep Del to select and add to stat sample Revision I].[Select]
HAVING ((([Corrsep Del to select and add to stat sample Revision I].Channel)="c") AND (([Corrsep Del to select and add to stat sample Revision I].Delegated)=1));
Go to Top of Page

bferriter
Starting Member

34 Posts

Posted - 2005-04-21 : 15:25:25
quickest way i can think of is to create a side table and pull 1 record at a time, 265 times, using a random number as your seed for selection.. if you were coding back end, use a loop with a counter and re-generate a random number each time you select a record, then insert that record to a temp table. that will generate the random selection...
Go to Top of Page

MattieBala69
Starting Member

30 Posts

Posted - 2005-04-21 : 16:28:06
thank you i will try that.
Go to Top of Page
   

- Advertisement -