• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Randomizing results in queries

Community Beginner ,
Jul 19, 2006 Jul 19, 2006

Copy link to clipboard

Copied

Lets say that I have 24 records in a table... I want to be able to return 1 row only, but randomize which row is returned each time the query is accessed.

Note: I am currently using MX 6.1, so functions available in 7 obviously will not work.

Many thanks in advance.

-Nathan
TOPICS
Advanced techniques

Views

206

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jul 19, 2006 Jul 19, 2006
Nevermind... I did a little RandRange on the RecordCount of the query, and then just relooped it to give me a different output on <cfoutput query="myquery" maxrows="1" startrow="#myRandNum#">

I fingered it out.

Thanks for reading, though. 🙂

Votes

Translate

Translate
Community Beginner ,
Jul 19, 2006 Jul 19, 2006

Copy link to clipboard

Copied

LATEST
Nevermind... I did a little RandRange on the RecordCount of the query, and then just relooped it to give me a different output on <cfoutput query="myquery" maxrows="1" startrow="#myRandNum#">

I fingered it out.

Thanks for reading, though. 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation