I wouldn't do that because there's no guarantee that tblbannerimages has five records, or that their values are 1-5.
-Joe On Wed, 02 Mar 2005 16:34:40 -0400, Will The Game <[EMAIL PROTECTED]> wrote: > Question: Why couldn't I use RandRange in a query to rotate a banner image? I > usually use JS buit it looks like a bunch of crap code. *This* would be > simple. > > I have a tblbannerimages with ID# as PK, imagename is like image1.jpg or > whatever. > > ID's would be 1, 2, 3, 4, 5 let's say > > Now I run a query to retrieve one to output it to the banner everytime the > page loads. > > SELECT ID, imagename > FROM tblbannerimages > WHERE ID = #RandRange(1,5)# > > Then it goes in the banner. > > <cfoutput><img src="#getimages.imagename#"></cfoutput> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197190 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

