Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-03-10
3
Medium Priority
?
52 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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Viewers will learn how the fundamental information of how to create a table.

721 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