I have a MySQL table named ‘events’ that contains event data. The important columns are ‘start’ and ‘end’ which contain string (YYYY-MM-DD) to represent when the events starts and ends.

I want to get the records for all the active events in a time period.

Events:

------------------------------
ID | START_DATE | END_DATE   |
------------------------------
1  | 2013-06-14 | 2013-06-14 |
2  | 2013-06-15 | 2013-08-21 |
3  | 2013-06-22 | 2013-06-25 |
4  | 2013-07-01 | 2013-07-10 |
5  | 2013-07-30 | 2013-07-31 |
------------------------------

Here is the simple solution fo that:-

Here lot of good answer which can help to select the current  data between the start date and end date.

select id  from events where ( NOW() BETWEEN start_date AND end_date) 

We can also use time instead of the date.