That anyone have a tutorial or an idea how to create a small program that pick a random winne from a customer table.if the customer is picked he can't be selected another time.
regards.
That anyone have a tutorial or an idea how to create a small program that pick a random winne from a customer table.if the customer is picked he can't be selected another time.
regards.
1. give all clients a unique sequenct number (client_seq) from 0 to n, n is number of clients.
2 select the client with client_seq=int(rnd * n) and never won
3 if no client return from 2, repeat step 2 (this happen when that client had been picked)
4 pick this client and update the win flag
George,
you can also use my Random Record function: http://www.ajenterprisesonline.com/A...RndRecord.html
The query for it is:Code:SELECT * FROM TABLE WHERE [field] = RndRecord("fieldname", "tablename")
hi,
i have the same exact case, and i used weekend00's Sollution and it worked fine.
But if i close access and reopen it with the old data i had before updating the win flag.
i will run through the same random selection i had in the first place..
is there anyway i can relate the random selection to datetime??
the link that Adam posted returned a sequencial selection..
i'm not sure if i used it right.
Thanks..
The RndRecord() line on this page: http://www.ajenterprisesonline.com/ab/_functions/ gives you instructions on how to use the function as a call from a query.