Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2003

    Unanswered: random display from database

    i have manage to extract my information from the database and have arranged it in the way i want it to appear from got stock, out of stock and preorder....

    my code:

    <%sql = " Select products.*, products.ccategory, categories.catdescription " &_
    " FROM categories INNER JOIN products ON categories.categoryID=products.ccategory " &_
    " WHERE products.ccategory= " & cInt(catID((j)))
    sql = sql & " ORDER BY products.stockquantity DESC, products.preorder ASC"
    set rs = server.CreateObject("ADODB.Recordset")
    rs.Open sql, dbc, adOpenStatic,adLockReadOnly,adCmdText

    HOWEVER when i add in the word 'RAND' after ORDER BY it did not do randomize and my order is mess up...

    can someone help me on it... thanx...

  2. #2
    Join Date
    Aug 2002
    Follow the syntax and other information from BOOKS ONLINE for RAND topic.
    --Satya SKJ
    Microsoft SQL Server MVP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts