Hi Peoples
I have the following query to retrieve data from the db. 2 of the things it has to do is give me the date of the last post and a count of the post records in each of the categories.
The last post date works fine but i cannot get the COUNT(threadID) to return anything but 1 record for each category.
Can someone PLEASE help
query is as follows:
---------------------------
<cfquery name="showcategories" datasource="#dsn#">
SELECT categories.catID, category, description, MAX(postdate) AS lastpost, COUNT(threadID) as postCount
FROM categories, threads
where categories.catID = threads.catID
Group by postDate, categories.catID, category, description
ORDER BY Category ASC, PostDate DESC
</cfquery>
by the way it makes no difference if I add the threadID to the group by line
thanks in advance
Grabit