0

enter image description here

i want to display all the dates that fall in a certain date range like

select * from table where column names <'certain date'

i have tried select * from table where columns<'certain date' but it doesn't work. The Type of these columns is of date type

  • Possible duplicate of [How to check in MySQL if any date in a range of dates falls between dates held in a table](http://stackoverflow.com/questions/35130602/how-to-check-in-mysql-if-any-date-in-a-range-of-dates-falls-between-dates-held-i) – Ruslan Osmanov Dec 03 '16 at 14:53

1 Answers1

0

Why can't you use BETWEEN operator to specify the date ranges like

where column_names between 'certain date' and 'certain other date'

(OR) using >= and <= operator

where column_names >= 'certain date' 
and column_names <= 'certain other date'

For multiple columns, you will have to include all of them using and / or condition

where column_name1 between 'certain date' and 'certain other date'
and   column_name2 between 'certain date' and 'certain other date'
Rahul
  • 76,197
  • 13
  • 71
  • 125