
Thanks BigKat..nice work. To take it one step further, how about the ability to produce a total number of conum’s and the sum of the Sumofbrandname columns. This would end up with including select count (conum), sum(sumofbrandnames) as the final result. Can this also be added to the above query?

It seems to be very simple in SQL Server.
I tried to make a SQL standard query using subselect, in order to get the same results in another database manager.
Here it is:
select tmp.Eff_date, tmp.CoNum, sum(tmp.CountOfBrandname) from
( select Eff_date, CoNum, count(Brandname) as CountOfBrandname, Brandname, Dateapplied
from Products
where Eff_date between ‘01/02/2011′ and ‘05/02/2011′
group by Eff_date, CoNum, Brandname, Dateapplied) as tmp
group by tmp.Eff_date, tmp.CoNum;
Tell us if you get the desired results.
Regards.

thanks Mariodlg, but no go. I have a solution to the original question but look at the next post for more…















