Check out example codes for "mysql filter based on datediff". It will help you in understanding the concepts better.

Code Example 1

SELECT *
FROM myTable
WHERE birthdate >= 'date1' AND death <= 'date2' AND age > 17 AND age < 55;

Learn ReactJs, React Native from akashmittal.com