> > I am using a varent from sparty2809 on http://tutorial323.easycfm.com/ > > It works great but was created for ACCESS and uses an autonumber > > datatype. Its great when you just keep adding advertisments but when > > you delete one there is now a gap in the +one ADID (int - identity > > specification). When the RandRage counts the MAX ADIDs and then picks > > a ad. If it hit the number that was deleted it just shows.. nothing. > > This is a code breaker for me i cant have gaps. > > Could you convert your query data into an array? > > Then get a randRange() using the arraylen(). > > Then refer to your array with the randRange number.
My recommendation would be a little different... <cfset x = randrange(1,query.recordcount) /> <!--- display the add or whatever ---> <cfoutput query="query" startrow="#x#" maxrows="1"> ... do your thing ... </cfoutput> The problem with converting to an array is that it can be a fair amount of overhead (query to array-of-structs is what I'm envisioning here) when the query itself actually comes with features that make it really easy to use natively as well as being very mechanically efficient. -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 781.769.0723 http://onTap.riaforge.org/blog ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316231 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4