Answer the question
In order to leave comments, you need to log in
How to write a request with BETWEEN?
The database has 2 fields with dates. The from and to fields contain dates from and to , such as 20150517 and 20150520 .
I send two dates in the form, and those users who enter the specified period are shown.
Answer the question
In order to leave comments, you need to log in
Already figured out, you can delete the question), and if not, maybe someone will come in handy.
SELECT * FROM student WHERE DATE(from_date) >= '2015-05-01' AND DATE(to_date) <= '2015-05-23'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question