The SQL BETWEEN Operator selects values within a range. The values can be numbers, text, or dates. Is possible to select values outside a range using NOT BETWEEN. The BETWEEN operator can produce different result in different databases: In some databases excludes the test values, in some others include them and in some cases includes the first test value and excludes the last one.
Questions tagged [between]
1363 questions
-2
votes
1 answer
How to Extract String between two braces - javascript
I have string like this {employee name} some text {employee designation} some text {practice} some text {from date} to {to date} {from date}
I want employee name,employee designation,practice and so how to do this in javascript
-2
votes
1 answer
Prolog: How to create a program that doesn't allow for a number to be neighbour to another number
I want to write a prolog program that needs a number to stay between 2 other numbers but to not have a specific number as his neighbour.
For exemple i have the numbers 1,2,3,4,5. I want for number 5 to stay between any other number except 4.
How…

Lame Fanello
- 545
- 1
- 6
- 15
-2
votes
4 answers
MySQL current date between 2 set dates
I need some help with a project I'm working on.
There's a table with 2 dates: date1 and date2 (easier)
Now I need to show all rows where the current date is between date1 and date2.
What I have so far is:
$date = date(Y-m-d);
$sql = 'SELECT * FROM…

G Buis
- 303
- 4
- 17
-2
votes
1 answer
Multipy number is between two numbers from a fix table
Here is the challenge
I have a bounce table where is I sell in between 2 values then I will get specific bounce.
let say that the table is as follow:
between 1000 to 1500 I will get 2 points of bounce
1000 - 1500 = 2
1500 - 2000 = 4
(this table is…

Rahim
- 13
- 3
-2
votes
1 answer
PL/SQL compare more values using between
I have a problem with my query. I need to compare more than 50 values if it is between 2 columns. For example, I have two varchar columns:
col1 col2
-----------
1000 1999
2000 2999
3000 3999
and I have values 1001, 2001, 3001, 4001.
And I…

Barki
- 13
- 1
- 3
-2
votes
2 answers
Issue while fetching dates between range
I have two tables. One is hall which is having following schema.
One hall can have many events.I want halls which are available between two dates.For example halls between 2016-09-10 and enddate = 2016-09-15.
I want all the halls which are not…

Nishant Dongare
- 549
- 3
- 16
-2
votes
1 answer
Formula to obtain a value if it is the same destination and in between the range in Excel
We have this table
+--------------+-----------+----------+-------+
| Destination | Beginning | End | Value |
+--------------+-----------+----------+-------+
| Riohacha | 0 kg | 500 kg | $100 |
| Riohacha | 501 kg | 1000 kg …

Luis Amaris
- 3
- 1
-2
votes
1 answer
Get records between two date range in MYSQL
I have a table in my mysql db. This is my table.
material sorg f_date t_date
2000012 2100 2016-05-01 2016-05-30
2000013 2100 2016-05-01 2016-05-21
2000021 2200 2016-05-01 2016-05-30
2000151 …

D.Madu
- 507
- 2
- 8
- 28
-2
votes
4 answers
mysql query where IN statement
I want to do the following:
SELECT count(id) FROM table WHERE value BETWEEN 3 AND 40;
But it should do the following:
SELECT count(id) FROM table WHERE value IN(3, 4, 5, 6, 7, 8, 9, 10, 11, ..., 40);
It should even print out zero count(id) for…

Vincent
- 2,342
- 1
- 17
- 22
-2
votes
1 answer
Calc Between Date On sql OR Asp.net
i can Calc Between 4 Date
StratDate: 1394/01/01 EndDate: 1394/01/30
Case1: how Calc only 15 day first
Case2: Continue 15 To 31
i have use Sql server and vb.net
Start from 1394/01/01 to 1394/01/15 = 15
continue 1394/01/15 to 1394/01/30 =…
-2
votes
2 answers
Php preg_match_all from a json document
Hello I would like to use preg_match_all in PHP to parse the "{"id":xxxxxxxxxx,"opponent"" out of the following from a json document.
I would like to get the following ids: 0:
3043248027
3041643291
3043251372
3041727642
3042908044
3041713366
…

M M
- 27
- 3
-2
votes
1 answer
MySQL Query: column BETWEEN A AND B OR C
I wondered if I can get a query like this to work:
"DELETE FROM table WHERE id (BETWEEN 1 AND 5) OR = 8;"
The thing I want to achieve: I want to say; get me the results between some values or also the value if my id = 8.
Unfortunately I only found…

Merc
- 4,241
- 8
- 52
- 81
-2
votes
2 answers
No results displayed when using BETWEEN with JOIN php/mysql
For some reason i can not get php/mysql to do JOIN with a between option. Am i over looking something again?
When i run this script all i get is a whit page with no errors on it....?
Any ideas would help!
$start = date("m/1/Y");
$end =…

Kelly Hansen
- 69
- 10
-2
votes
1 answer
Starting a method when a value goes outside its bounds
I am coming up with a little trouble with the following code. Essentially I am trying to start a method whenever the value goes between 45 and 46 and subsequently goes outside of these bounds.
if(value >= 45 && value < 46){
if(value >= 46 &&…
user4179004
-2
votes
3 answers
Select between two dates in European Format
The following query doesn't return any results when I try to select records between February and March.
Here is the query that I'm using :
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM data WHERE CONVERT(VARCHAR(50),data,105) BETWEEN …

user3334406
- 337
- 4
- 16