Re: Random sort via SQL in ASP



On Apr 12, 7:33 pm, "muskie" <goo...@xxxxxxxxxxxxxxxx> wrote:
I've looked through as many posts about this as possible, but all end
with no resolution. I simply need records from a table in random
order, and I will be calling this recordset in a SQL statement from
ASP. I've tried the following but it does not produce random order:

SELECT * FROM Table1 ORDER BY Rnd(TableID) ASC;

where TableID is an autonumber field.

I've seen references to Randomize, but how do you use Access's
randomize from ASP?

Does anyone know of a simple solution for this?

Thanks,
Matt

I'd be surprised if you can use this in SQL using the method you are
trying. I'd write some code that you can trigger that puts a random
number in a field (e.g. sortfield as long) in the table. Then you can
select and order by that random field (e.g. ORDER BY sortfield). This
will certainly get the job done. Whenever you want a different
randomizing, then trigger the code.

-- Larry Engles

.



Relevant Pages

  • Re: Random sort via SQL in ASP
    ... randomize from ASP? ... I'd write some code that you can trigger that puts a random ... number in a field (e.g. sortfield as long) in the table. ... select and order by that random field (e.g. ...
    (comp.databases.ms-access)
  • Re: Formatierungsproblem
    ... > Wie soll denn so ein EIN SQL Statement aussehen? ... > IE Schwierigkeiten bei der Darstellung und schließlich auch bei der ... ja nie welchen Browser der User hat, wie er diesen konfiguriert hat usw. ... > Ich sollte wirklich versuchen alles mit ASP zu managen. ...
    (microsoft.public.de.inetserver.iis.asp)
  • Re: System.Data.SqlClient.SqlException: Subquery returned more than 1 value.
    ... I noticed after I posted that the group was .asp not aspnet, ... >> following SQL statement. ... >> INSERT INTO OrderItems (ClientID, ProductID, OrderHeaderID, Quantity, ... >> Dim conn As New System.Data.SqlClient.SqlConnection ...
    (microsoft.public.inetserver.asp.db)
  • RE: Is this correct syntax for OLE DB for ODBC parameter query?
    ... (Just a brief review of that SQL statement) ... You may have more information from ASP .NET team. ... data showing up in the second list when the page loads or I make a selection ...
    (microsoft.public.data.odbc)
  • xp_sendmail in trigger from asp page -error
    ... encrypted sp for inserting data. ... 1.when i remove the trigger, data is getting inserted from asp form. ... @subject varchar, ...
    (microsoft.public.sqlserver.programming)