$ 0 0 Why max for 20142 is 201405 and not 201406?Cant you just group by quarter field and use max(month)?