SQL: "SELECT TOP 6" results entire table
Results 1 to 3 of 3

Thread: SQL: "SELECT TOP 6" results entire table

  1. #1
    Registered User
    Join Date
    Jun 2001
    Posts
    1,822

    SQL: "SELECT TOP 6" results entire table

    I wrote this query:
    SELECT TOP 6 * FROM tblProducts ORDER BY FeaturedItem

    But it's returning me the entire table rather than the TOP 6 records, I've never had to use TOP before but I'm pretty sure that's the right syntax but it probably isn't.

    Also, did they remove the ability to write your own SQL in Access 2003? I onlyfindthose stupid wizards and tables that write the queries for you and can't find where to make and run my own query, this was very easy to find in Access 2000 or XP but I just can't find it anywhere in 2003.

    Thanks

  2. #2
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    so this access sql? or another sql server? It makes a difference.

    Oh yeah open a query in design view then right click select sqlview

    TopValues setting (see help in access) is the thing that uses top n in a select statement. It has some quirks... have a read of the example in help.
    Last edited by NooNoo; March 12th, 2005 at 11:37 AM.

  3. #3
    Registered User
    Join Date
    Jun 2001
    Posts
    1,822
    Yes it is Access SQL

    Thanks

Similar Threads

  1. MS SQL Server 2005 : Express Manager CTP + Express Edition CTP
    By TechZ in forum Other Software Applications
    Replies: 0
    Last Post: December 5th, 2004, 06:34 AM

Bookmarks

Posting Permissions

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