Sorry... On re-reading... I didn't even make sense to myself! :D
> > <cfquery datasource="#dsn#" name="pickids"> > > SELECT id > > FROM diary > > WHERE edpick = 'yes' > > </cfquery> > > > > <cfset list = valuelist(pickids.id)> > > <cfset picklist = ListLen(list)> > > <cfset place = randRange(1,picklist)> > > <cfset randpick = ListGetAt(list, place)> Basically, the issue is that if the query returns no records, then the place variable can be 1 or 0 because they are the only things that can be returned by randrange(1,0). Otherwise, it's impossible to get 0 in randpick. HTH Paul -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
