Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6379525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:08:59+00:00 2026-05-25T02:08:59+00:00

In SQL you have the ability to write a query that executes a between

  • 0

In SQL you have the ability to write a query that executes a between on a column that is of type ‘nvachar’ and simply returns to you all the rows that are between the min and max values specified.

For Example,

Table (Id:Int, Name:nvarchar):

Contents:
1, Annie
2, Bill
3, Frank
4, Phil
5, Ted

Select * where Name Between 'Frank' and 'Ted'

Should return Frank, Phil, and Ted.

Is there a way to do this with linq or am I going to have to create a custom query and execute it? The only examples I have seen involve dates or integers which make it very easy (can use the comparison operators like <, > etc).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:08:59+00:00Added an answer on May 25, 2026 at 2:08 am

    You’d use CompareTo instead:

    var query = from name in names
                where name.CompareTo("Frank") >= 0 &&
                      name.CompareTo("Ted") <= 0
                select name;
    

    Use > and < to be exclusive (i.e. to exclude Frank and Ted).

    Basically it’s the same as using < and >, but with methods 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the ability to query a legacy system that returns a .NET DataSet.
I have recently discovered the ability to use WHERE clauses within indexes in SQL
I have SQL data that looks like this: events id name capacity 1 Cooking
I have SQL query, which is working nice on Oracle and MSSQL. Now I'm
First of all I'm really not that great at sql, with that said, onwards
I currently have the ability to execute a sql statement, return the info, and
Within an SQL stored procedure, I would like to have the ability to construct
I have sqlite3.dll but I'm assuming it's far more complex than simply including that
We have SQL Server 2005 running on Win2003/64, and we push it hard. We
We have SQL Server database setup. We are setting up a replication scenarios where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.