Skip to main content
deleted 32 characters in body
Source Link
ROMANIA_engineer
  • 57k
  • 30
  • 211
  • 207

If I run a query with a between clause, it seems to exclude the ending value.
For example:

select * from person where dob between '2011-01-01' and '2011-01-31' 

This gets all results with dob from '2011-01-01' till '2011-01-30'; skipping records where dob is '2011-01-31'. Can anyone explain why this query behaves this way, and how I could modify it to include records where dob is '2011-01-31'? (without adding 1 to the ending date because its been selected by the users.) Thanks in advance for any help.

If I run a query with a between clause, it seems to exclude the ending value.
For example:

select * from person where dob between '2011-01-01' and '2011-01-31' 

This gets all results with dob from '2011-01-01' till '2011-01-30'; skipping records where dob is '2011-01-31'. Can anyone explain why this query behaves this way, and how I could modify it to include records where dob is '2011-01-31'? (without adding 1 to the ending date because its been selected by the users.) Thanks in advance for any help.

If I run a query with a between clause, it seems to exclude the ending value.
For example:

select * from person where dob between '2011-01-01' and '2011-01-31' 

This gets all results with dob from '2011-01-01' till '2011-01-30'; skipping records where dob is '2011-01-31'. Can anyone explain why this query behaves this way, and how I could modify it to include records where dob is '2011-01-31'? (without adding 1 to the ending date because its been selected by the users.)

added 78 characters in body
Source Link
ASD
  • 5k
  • 11
  • 39
  • 57

If I run a query with a between clause, it seems to exclude the ending value.
For example:

select * from person where dob between '2011-01-01' and '2011-01-31' 

This gets all results with dob from '2011-01-01' till '2011-01-30'; skipping records where dob is '2011-01-31'. Can anyone explain why this query behaves this way, and how I could modify it to include records where dob is '2011-01-31'? (without adding 1 to the ending date because its been selected by the users.) Thanks in advance for any help.

If I run a query with a between clause, it seems to exclude the ending value.
For example:

select * from person where dob between '2011-01-01' and '2011-01-31' 

This gets all results with dob from '2011-01-01' till '2011-01-30'; skipping records where dob is '2011-01-31'. Can anyone explain why this query behaves this way, and how I could modify it to include records where dob is '2011-01-31'? Thanks in advance for any help.

If I run a query with a between clause, it seems to exclude the ending value.
For example:

select * from person where dob between '2011-01-01' and '2011-01-31' 

This gets all results with dob from '2011-01-01' till '2011-01-30'; skipping records where dob is '2011-01-31'. Can anyone explain why this query behaves this way, and how I could modify it to include records where dob is '2011-01-31'? (without adding 1 to the ending date because its been selected by the users.) Thanks in advance for any help.

added 125 characters in body; edited tags; edited title
Source Link
Donut
  • 113.5k
  • 20
  • 136
  • 147

between MySQL "between" clause in mysqlnot inclusive?

IF iIf I run a query with betweena between clause its excluding, it seems to exclude the endending value.
  
Eg, select * from person where dob between '2011-01-01' and '2011-01-31'
--> In this its getting the result withFor example:

select * from person where dob between '2011-01-01' and '2011-01-31' 

This gets all the dobresults with dob from '2011-01-01' till '2011-01-30' and30'; skipping records withwhere dob is '2011-01-31'

 . Can anyone tellexplain why? this query behaves this way, and how I could modify it to overcome.include records where dob is '2011-01-31'? Thanks in advance for any help.

between clause in mysql

IF i run a query with between clause its excluding the end value.
  Eg, select * from person where dob between '2011-01-01' and '2011-01-31'
--> In this its getting the result with all the dob from '2011-01-01' till '2011-01-30' and skipping records with '2011-01-31'

  Can anyone tell why? and how to overcome.?

MySQL "between" clause not inclusive?

If I run a query with a between clause, it seems to exclude the ending value. 
For example:

select * from person where dob between '2011-01-01' and '2011-01-31' 

This gets all results with dob from '2011-01-01' till '2011-01-30'; skipping records where dob is '2011-01-31'. Can anyone explain why this query behaves this way, and how I could modify it to include records where dob is '2011-01-31'? Thanks in advance for any help.

Source Link
ASD
  • 5k
  • 11
  • 39
  • 57
Loading