Select only date where belong to three months

Hi…

I just want to know what would be the query if I just want to select date is the first 3 months.

for example.

I have month in dates
sampe:
ETD = April, May, June, July, August.

And now I just want to select is the first 3 months and its (April, May, June).

Thank you

use SUBSTRING_INDEX function

How?

Thank you

http://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_substring-index

Hi…

I need help in selecting first 3 Consecutive Months from my table ETD which type is Date.

for example in my ETD:

2012-04-01
2012-04-01
2012-04-05
2012-04-08
2012-04-08
2012-05-01
2012-05-01
2012-05-05
2012-05-08
2012-05-08
2012-06-01
2012-06-01
2012-06-05
2012-06-08
2012-06-08
2012-07-01
2012-07-01
2012-07-05
2012-07-08
2012-07-08
2012-08-01
2012-08-01
2012-08-05
2012-08-08
2012-08-08

Now from this ETD data:

I need to select only are:
(from April - June)
2012-04-01
2012-04-01
2012-04-05
2012-04-08
2012-04-08
2012-05-01
2012-05-01
2012-05-05
2012-05-08
2012-05-08
2012-06-01
2012-06-01
2012-06-05
2012-06-08
2012-06-08

Thank you

SELECT daTable.etd
  FROM ( SELECT MIN(etd) - INTERVAL DAYOFMONTH(etd) - 1 DAY AS firstday
           FROM daTable ) AS m
INNER
  JOIN daTable
    ON daTable.etd >= m.firstday
   AND daTable.etd  < m.firstday + INTERVAL 3 MONTH