Solved

SQL Between using multiple rows from 2 colums (start and end)

Posted on 2014-03-10
3
45 Views
Last Modified: 2016-05-29
I'm trying to pull data from a table and my where clause contains needs to contain a BETWEEN condition.  Basically a Start code and an End code.  Each Item that I'm pulling data can contain any number of lines in this table from 1 to over 600 lines.  So, I need to be able to query the table when the user enters a code to look to see if it falls into a range that has been established (start and end).  Each range varies in size.  

Is there a way to check 600 lines to see if the code that was entered by the user falls into any of the ranges?  I would like to avoid FETCH sql, because some of the code I still need to use in Access!  But I'll take any help at this point too!!!!  Thanks.
0
Comment
Question by:sborchers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39919182
Could you do something like this:

SELECT * FROM YourTAble WHERE Col1 > YourFirstValue AND Col2< YourSecondValue

If not, could you provide more information about your tables, and show some sample data, along with some desired results?
0
 

Author Comment

by:sborchers
ID: 39919329
I will give it a shot in the morning and if it doesn't work I'll try to provide more details.  Thanks, Mike
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Viewers will learn how the fundamental information of how to create a table.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question