If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How randomly choose a field value in Access to display
I would like to set up a fairly simple database and as oneof the reports, I'd
like the software to randomly choose from all of the available values in one specific field and display the record containing that value. Is there a fairly simple way to do this? I'm not very familiar with programming or macros but could maybe handle something basic. Otherwise a formula using date & time or something like that? |
#2
|
|||
|
|||
How randomly choose a field value in Access to display
On Mon, 28 Sep 2009 07:51:01 -0700, Julie in Wisconsin Julie in
wrote: I would like to set up a fairly simple database and as oneof the reports, I'd like the software to randomly choose from all of the available values in one specific field and display the record containing that value. Is there a fairly simple way to do this? I'm not very familiar with programming or macros but could maybe handle something basic. Otherwise a formula using date & time or something like that? Here's an article on selecting random records: http://blogs.techrepublic.com.com/howdoi/?p=149 It basically involves including a calculated random number column in your query, then using that column to sort on. You can use TOP 1 to select the "winner". Armen Stein Microsoft Access MVP www.JStreetTech.com |
#3
|
|||
|
|||
How randomly choose a field value in Access to display
Try this using any number field in you table for [PersonID] ---
SELECT TOP 1 YourTable.*, Rnd([PersonID])*1000 AS Expr1 FROM YourTable ORDER BY Rnd([PersonID])*1000 DESC; -- Build a little, test a little. "Julie in Wisconsin" wrote: I would like to set up a fairly simple database and as oneof the reports, I'd like the software to randomly choose from all of the available values in one specific field and display the record containing that value. Is there a fairly simple way to do this? I'm not very familiar with programming or macros but could maybe handle something basic. Otherwise a formula using date & time or something like that? |
Thread Tools | |
Display Modes | |
|
|