0

Why MySQL in following query:

select * from `tips` 
where `tips`.`tipster_id` = '16' 
and `result` <> '0' 
and `date` >= '2014-02-01' 
and `date` <= '2014-02-28'

excludes rows with date 2014-02-28 ???

1
  • Yes, they are here... Commented Jan 3, 2015 at 18:11

2 Answers 2

2

Do you store time values in that column? I guess that 2014-02-28 is this is the same as 2014-02-28 00:00:00.

So date values with a time after 00:00:00 will not be included.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I store time also, and time is not 00:00:00 but something like 15:20:00. Ok, I know what is the problem, thanks.
1

I use this version

select * from `tips` 
where `tips`.`tipster_id` = '16' 
and `result` <> '0' 
and `date` >= '2014-02-01 00:00:00' 
and `date` <= '2014-02-28 23:59:59'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.