You could also use query of queries for the second one and either cache the first query or save it in a application variable if the tips don't change often.
Kathy -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Elmore Sent: Tuesday, May 03, 2005 5:30 PM To: [email protected] Subject: RE: Ramdom tip... It takes two queries but you could: <cfquery name="TipIDs"> select ID from ... </cfquery> <cfquery name="Tip"> select Tip from ... where ID = #TipIDs.ID[RandRange(1,TipIDs.RecordCount)]# </cfquery> <cfoutput>Tip: #Tip.Tip#</cfoutput> - Daniel -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Javier Flores Sent: Tuesday, May 03, 2005 4:05 PM To: [email protected] Subject: RE: Ramdom tip... Ups! Sorry I'm using Access... Javier -----Mensaje original----- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Ryan Everhart Enviado el: Lunes, 02 de Mayo de 2005 09:47 p.m. Para: [email protected] Asunto: Re: Ramdom tip... If you are using SQL server you can write a query like this SELECT Tip_ID, Tip FROM TipTable ORDER BY NEWID() The key is the ORDER BY NewID() On 5/2/05, Javier Flores <[EMAIL PROTECTED]> wrote: > > > > > I would like to RAMDOM a tip on my home pageâ do you have any code to > do this? > > > > I have and ID and the TIP on the tableâ > > > > Thanks, > > > > Javier NÅhÂÃÂÃÂj)mÂXÂÂÃÃqà ÂÂÂÃÃÂÂÂ&ÃâÃiÃÃ0ÃÃÃqà ÂÂ?~ÅÃ1ÃâzÂ'ÂÃÃrÂâyÃÃNâ.nÃ+âÂÂÂÃà 0uÃ~Ã(ÂÃÂÂÅzfàÅÃkjÃÂÂÃà ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm
