> i am not sure about the order database, but i think it doesn't
> work in MSSQL
> since Rand function always return the same value in all rows in one query.
I didn't try it so oops, but to this and it will work:
> <cfquery name="getPhoto" datasource="dsn">
> SELECT TOP 1 items, rand(either a unique_ID column or NewID() ) as
orderCol
> FROM db table
> ORDER BY orderCol #IIF(getTickCount() MOD 2, DE("ASC"), DE("DESC"))#
> </cfquery>
Just creating a newID will return the rows sequentially which isn't random.
Marc
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Marc Campeau" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)