I have a query like
Select Category, Sum (Cost), Format([OrderDate],"ww")
from OrderTable
GROUP BY Category, Format([OrderDate],"ww")
--HAVING customer <> 12
Now I want to make sure NOT to include the rows with customer = 12 in calculating the cost column.
I do not want to Group it y customer. But the query does not let me use Customer column in Having clause if I dont use it in group by.
Select Category, Sum (Cost), Format([OrderDate],"ww")
from OrderTable
GROUP BY Category, Format([OrderDate],"ww")
--HAVING customer <> 12