Hi Alex, > ...now if questreg = 2,8,4,6 the questions come up > in ascending numerical order.... > How do I change this so it comes up in the order I > requested?
SQL doesn't work like that. It returns the results based on the order you have included in your ORDER BY clause, which is one of ASC or DESC based on a specific field. You have a couple options: 1) add an additional temporary field which will be used solely to provide a sorting key. This would require initially enumerating the records in some manner in order to assign values to the order you want them. It's in no way easier, and if your attempt is to essentially randomize the order of the records it's a bloated and unreliable solution. 2) Return the results into an array (GetRows) then filter the results or enumerate the specific id key in order to find the record you want to play with. It's much faster, leaner, and less memory intensive. If you're just wanting to randomize the order of the resultset you could use an order by on a random number value. Look in your database version SQL guide to find out how to do that with your database type. Regards, Shawn K. Hall http://ReliableAnswers.com/ '// ======================================================== A university professor set an examination question in which he asked what is the difference between ignorance and apathy. The professor had to give an A+ to a student who answered: I don't know and I don't care. -- Richard Pratt, Pacific Computer Weekly, 20 July 1990 ------------------------ Yahoo! Groups Sponsor --------------------~--> $9.95 domain names from Yahoo!. Register anything. http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/17folB/TM --------------------------------------------------------------------~-> --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [EMAIL PROTECTED] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
