I am having a little trouble combining the following 2 queries into a single nested statement (if indeed it's possible). Can anyone assist?
SELECT Eff_Date, CoNum, Brandname, COUNT(Brandname) AS CountOfBrandName FROM dbo.Products WHERE (Eff_Date BETWEEN '1/1/2010' AND '12/31/2010') GROUP BY Eff_Date, CoNum, Brandname, DateApplied
SELECT Eff_Date, CoNum, SUM(CountOfBrandName) AS SUMofBrandNames FROM dbo.Query1 GROUP BY Eff_Date, CoNum ORDER BY Eff_Date
Can anyone assist in combining these 2 queries into a single nested statement? Can it be done without using a temp table?
March 4, 2011 3:34 PM
March 4, 2011 7:20 PM