Here's my suggested modification <!--- Gets Maximum number of ads---> <CFQUERY DATASOURCE="#Green#" NAME="getCachedAds" cachedwithin="#CreateTimeSpan(1,0,0,0)#"> SELECT * dbo.banner_left </CFQUERY>
<!--- RandRange is Random integer between first number and second(1st,2nd) ---> <CFSET ADID = getCachedAds.ADID[RandRange(1,getCachedAds.recordcount)]> <!--- Calls up all columns in table ---> <CFQUERY NAME="GetADs" dbtype="query"> SELECT * FROM getCachedAds WHERE ADID = #ADID# ORDER BY ADID </CFQUERY> Not sure why there even was an order by in that query originally, since it will only return one record anyway. Probably won't affect performance, but you may as well drop the order by. hth, ike -- 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:316232 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4