473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

Query value in between two columns

Max
Hi All,

I am new to Sql and I want to know if a given value lets say its 225
is within ranges defined in the table.

I have a table TblControl. Data type of both field is int.

StartRange End Range
0 100
200 300
500 600
900 950

(Sql server 2000 on window 2000)

Thanks
-Max
Jul 20 '05 #1
2 12314
On 26 Aug 2004 12:13:48 -0700, Max wrote:
Hi All,

I am new to Sql and I want to know if a given value lets say its 225
is within ranges defined in the table.

I have a table TblControl. Data type of both field is int.

StartRange End Range
0 100
200 300
500 600
900 950

(Sql server 2000 on window 2000)

Thanks
-Max


Hi Max,

You can test this with BETWEEN. Example:

SELECT StartRange, EndRange
FROM Control
WHERE 225 BETWEEN StartRange AND EndRange

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 20 '05 #2
Max
Thanks Hugo,

It solved my problem.

-Max
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: adam | last post by:
Hello, I have a MySQL table that has (among other fields) an affiliate_id, affiliate_sub_id, and a response_code field. - affiliate_id stores the unique number of each of my affiliates. -...
4
by: Stuart E. Wugalter | last post by:
Here is a sample of what I want to do: Table 1 ID FIELD1 FIELD2 1 A T 2 G C 3 T C Table2 ID FIELD1 FIELD2
1
by: Anna | last post by:
I have a simple DataGrid that displays a list of characteristics and allows you to edit a description for each characteristic. The query that feeds this involves a join, as the characteristics and...
3
by: amjad | last post by:
Hi i have a webpage which has datagrid with one column called customer ID.. that customer ID is hyperlink mean i a click that customer ID it open a web page and display that customer ID on that...
2
by: zdk | last post by:
I have table name "actionlog",and one field in there is "date_time" date_time (Type:datetime) example value : 11/1/2006 11:05:07 if I'd like to query date between 24/07/2006 to 26/07/2006(I...
1
by: satish.vell | last post by:
Hi, I have a ASP.NET page inside which I toggle the display of a field using javascript. How can I save this display value between postbacks. Here is my code: <pre>
7
by: vbatnight | last post by:
Ok...I'm hoping someone has a simple solution for this problem. I need to find the value between two other values. For Instance: the 44 quick brown foxes jumped over 33...
4
by: m.wanstall | last post by:
I have a crosstab query that compiles data for Months of the year. I have a stacked select query on top of that crosstab query that uses the latest 2 months data and exports it to a fixed length...
1
by: =?Utf-8?B?Sm9zZXBoIEsuIENvYmI=?= | last post by:
I was wondering if there is a simple way to persist a value between calls to a Webservice that would yield something similar to a Session variable or Query string? Specifically, I'm trying to pass...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.