#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    DE
    Posts
    2
    Rep Power
    0

    Exclamation Return specific amount of records


    Some help would be greatly appreciated:

    I have a select statement:

    select contactid,company,fname,lname from tblcorecontacts where lstedited <= getdate()

    I am missing the means to restrict records to 10.

    I have a asp page that is to show the last 10 records (or no more than) of contacts that have been modified.

    So, what I'm saying is please helpme to add to my select statement to use the count or other function to stop showing records when they are >= 11

    Any help would be much appreciated.
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,118
    Rep Power
    4274
    select top 10
    contactid,company,fname,lname
    from tblcorecontacts
    where lstedited <= getdate()
    order by lstedited desc
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    DE
    Posts
    2
    Rep Power
    0

    the best!


    r937,

    your the best!

    It worked great, I wasn't aware of the top command.

    You just solved a big problem for me.

    Thanks a million!!

IMN logo majestic logo threadwatch logo seochat tools logo