Jump to content
  • 0

How to search for "n" random sample


RobertoCistia

Question

Hi all,

 

So I have in a table a field that contains images, and they have different categories in other fields. I want to have a form that lets me search for a N number of images that match my search criteria, but it should return a random sample N.

For example, let's say I have a database of dogs with a field for dog_images, a field for dog_breed and another for dog_size, I would like to choose how many images I want of dogs in a certain breed and size, say for example 5 images of small Poodles. It would return 5 random images, and every time I run this query I would get a random sample that matches the criteria, and generate a report with the images.

How do I get a random sample from a query?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Thank you @Meekeee. I have seen that first one before. It looks good but not quite what I want, because in this example you set up in advance a fixed number of results to be displayed. The part about sorting randomly would work for me, but I just wanted to give the user running the query the option to specify how many results to show, instead of previously setting a fixed number myself.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...