select convert(concat(convert(year(curdate()),char(4)),'-',convert((floor(quarter(curdate())/4) + (quarter(curdate()) mod 4)),char(2)),'-1'),date) as firstDayOfQuarter,
last_day(date_add(convert(concat(convert(year(curdate()),char(4)),'-',convert((floor(quarter(curdate())/4) + (quarter(curdate()) mod 4)),char(2)),'-1'),date),interval 2 month)) as lastDayOfQuarter,
date_add(convert(concat(convert(year(curdate()),char(4)),'-',convert((floor(quarter(curdate())/4) + (quarter(curdate()) mod 4)),char(2)),'-1'),date),interval 3 month) as firstDayOfNextQuarter,
last_day(date_add(convert(concat(convert(year(curdate()),char(4)),'-',convert((floor(quarter(curdate())/4) + (quarter(curdate()) mod 4)),char(2)),'-1'),date),interval 5 month)) as lastDayOfNextQuarter,
date_add(convert(concat(convert(year(curdate()),char(4)),'-',convert((floor(quarter(curdate())/4) + (quarter(curdate()) mod 4)),char(2)),'-1'),date),interval -3 month) as firstDayOfPreviousQuarter,
last_day(date_add(convert(concat(convert(year(curdate()),char(4)),'-',convert((floor(quarter(curdate())/4) + (quarter(curdate()) mod 4)),char(2)),'-1'),date),interval -1 month)) as lastDayOfPreviousQuarter
|