Results 1 to 3 of 3

Thread: SQL Server 2000 - LastName >= 'Robertson'

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    SQL Server 2000 - LastName >= 'Robertson'

    I want to be able to search a list of people and return everyone whose LastName >= 'Robertson'. I thought about creating a temp table with an Identity and then inserting the records in alphabetical order into that table. Then find the closest match, and selecting where IdentityField >= ClosestMatch's identity.

    Is there an easier way to do this?
    My.Settings.Signature = String.Empty

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: SQL Server 2000 - LastName >= 'Robertson'

    There is no need for a temp table. Using >= works correctly with strings. The Where clause you posted is all you need.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Re: SQL Server 2000 - LastName >= 'Robertson'

    Thanks. I tried it earlier, but must have missed something. I thought it should work, but wasn't certain. I will try a broader WHERE clause and see what happens.

    Thanks again!
    My.Settings.Signature = String.Empty

Posting Permissions

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



Click Here to Expand Forum to Full Width