Answered
Random Records Access Database RND() doesn't work
I am having a bugger of a time figuring this one out. I will
start by trying to explain what I want to do:
Goal: I want to list 12 randomly selected records from a my Access database.
Each time the page is refreshed I want a new set of 12 records listed. I have tried many solutions over the past few days to no avail! Here is what my query looks like:
<CFQUERY NAME="ctlst" DATASOURCE="absi" cachedwithin="#CreateTimeSpan(0,0,0,0)#">
SELECT TOP 12 prodmat.*
FROM Catfit INNER JOIN ProdMat ON Catfit.prodid=ProdMat.prodid WHERE Catfit.slsid=1
ORDER BY Rnd(prodmat.prodid)
</cfquery>
This gets me 12 random records once and then I get the same list over an over again on refresh.
Goal: I want to list 12 randomly selected records from a my Access database.
Each time the page is refreshed I want a new set of 12 records listed. I have tried many solutions over the past few days to no avail! Here is what my query looks like:
<CFQUERY NAME="ctlst" DATASOURCE="absi" cachedwithin="#CreateTimeSpan(0,0,0,0)#">
SELECT TOP 12 prodmat.*
FROM Catfit INNER JOIN ProdMat ON Catfit.prodid=ProdMat.prodid WHERE Catfit.slsid=1
ORDER BY Rnd(prodmat.prodid)
</cfquery>
This gets me 12 random records once and then I get the same list over an over again on refresh.
