DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: ascending order

  1. #1
    Join Date
    Mar 2006
    Posts
    20

    ascending order

    When i make a new table, sometimes,but not always, the products are not sorted in an ascending order, i do now know why but it happens.My commmand with which i make the table is the folowing
    Private Sub Command6_Click()
    Dim strProducts As String
    strProducts = " SELECT products.Productid, products.branch0 , products.items0 INTO ProductsTemp FROM products"
    CurrentDb.Execute strProducts
    End Sub
    I am applying an attachement.In this atachement the command has made a table where the last product is number 467. There are however also products number 471,472 and 473 but they are placed somehow higher u in the table, not below 467.What could i add on in my command so that to avoid such cases and the products be arranged in their ascending order ?
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Try adding an ORDER BY clause to your query to sort the records on the desired column, e.g.:

    SELECT productid, branch0, items0
    INTO ProductsTemp FROM Products
    ORDER BY productid
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. DOM and the order of its Nodes
    By Fredrik in forum XML
    Replies: 3
    Last Post: 04-08-2002, 08:13 AM
  2. Replies: 2
    Last Post: 03-18-2002, 12:52 PM
  3. order by clause in PL/SQL cursors
    By jasmeet in forum Database
    Replies: 1
    Last Post: 05-02-2001, 09:11 AM
  4. Re: Sort problem in MS SQL Server 7.0
    By D. Patrick Hoerter in forum Database
    Replies: 1
    Last Post: 06-26-2000, 04:57 PM
  5. Replies: 12
    Last Post: 05-23-2000, 06:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center