Solved

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

Posted on 2014-03-10
3
30 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
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Query output to Excel producing error 7 33
Dateadd 3 20
Access 2016 Merge Tables 8 25
Max per month 3 13
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now