A generic query would surfice. I would like to see the structure as the code below has failed to produce any results from the query at all. HAVING max(date) = date returned all the entries again. [code]$getcomments = $DB->query("SELECT commentid,pluginid, objectid, date, username,comment FROM " . TABLE_PREFIX . "comments WHERE pluginid = '819' AND objectid IN ( SELECT DISTINCT objectid FROM " . TABLE_PREFIX . "comments WHERE pluginid = '819' GROUP BY objectid HAVING max(date) ) ORDER BY DATE DESC LIMIT 0, $limit");[/code] BINGO! Thank you both for helping me find the way. My host is using 4.0.25. It's run on the test server but not the site. [code]$getcomments = $DB->query("SELECT commentid,pluginid, objectid, date, username,comment FROM " . TABLE_PREFIX . "comments WHERE pluginid = '819' AND objectid IN ( SELECT DISTINCT objectid FROM " . TABLE_PREFIX . "comments WHERE pluginid = '819' GROUP BY objectid HAVING max(date)= date ) ORDER BY DATE DESC LIMIT 0, $limit"); [/code]