Link to home
Start Free TrialLog in
Avatar of SimonSaysSQL
SimonSaysSQLFlag for United States of America

asked on

VBScript should generater random names but it selects the same peole each time

Hello, the attached vbscript is supposed to generate a random selection of names each time. Instead it is selecting the same names.

Thank you for your help.

Wendy
code-Random.txt
Avatar of SStory
SStory
Flag of United States of America image

I see nothing in your solution that would make anything random.  It goes to a table and gets data.  The data is the same.  You should either write a stored procedure if this is SQL Server that gets a random number of rows, or if the list isn't very long, you could get all of rows and use the basic RND function to choose random numbers and get those elements of the local collection or array where you stored the incoming rows.
Avatar of SimonSaysSQL

ASKER

S Story,
You are correct It is pulling data from a View. Apparently when you run the View in a Query it works and gives random data but when it is run with this code it keeps giving the same names.
I just found this out or I would have included it in the original message.
Thanks.
 
ASKER CERTIFIED SOLUTION
Avatar of SStory
SStory
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial