thanks guys....phv just what i wanted..but there's one thing maybe you can help me with...
I have two tables that i've joined together, and my data is insurance policies, so for each policy number there are maybe 1 2, 3 or 4 lines of data. How do i do it so that I can get a count of the policy number, and not the actual lines of data. Here's my sql which will give me the breakdown, but i just want to get a count for each category, and not line by line..
SELECT Partition([Age],16,90,5) AS AgeRange, Count(*) AS CountOfAge, Risks.[Policy Key], Count(Risks.[Policy Key]) AS [CountOfPolicy Key]
FROM Risks INNER JOIN Premiums ON Risks.[Policy Key] = Premiums.[Policy Key]
GROUP BY Partition([Age],16,90,5), Risks.[Policy Key];