MONTH(Date) not a column that you SELECT ed, so it cannot be displayed in your HAVING .
If you meant only SUM Bill from the lines where the month is between 1 and 3, then this is a WHERE , not a HAVING .
If all the rows in each PCI group have the same MONTH(Date) , then you can add MONTH(Date) to your SELECT to use it in the HAVING .
source share