0

I am using this query but it is not selecting the end date data, date 2018-04-07 and 2018-04-08 data selecting but not 2018-04-09

SELECT * 
  FROM ticket 
 WHERE created_date >= '2018-04-07'
   AND created_date <= '2018-04-09'
4
  • in your table, which formate used to store date? Commented Apr 18, 2018 at 13:59
  • type: time stamp and format: 2018-04-10 11:58:30 Commented Apr 18, 2018 at 14:00
  • Since you don't specify a time part '00:00:00' is assumed. Isn't it easier to do < '2018-04-10' Commented Apr 18, 2018 at 14:02
  • So what is your suggestion Commented Apr 18, 2018 at 14:05

1 Answer 1

2

Use this query

SELECT * 
FROM `ticket` 
WHERE `created_date` >= '2018-04-07 00:00:00:' AND `created_date` <= '2018-04-09 23:59:59'
Sign up to request clarification or add additional context in comments.

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.