I am trying to group records based on the id - it works fine until I need additional filters such as date. How can I group the records and also display other information. I included a screenshot to show how it is not displaying correctly - for example I would like the name Marketing to only display once.
Any help is appreciated
SELECT leadervotes.voteid, SUM(DISTINCT leadervotes.votelevel) AS Expr1, leadervotes.votedate, nominations.astname
FROM leadervotes INNER JOIN
nominations ON leadervotes.voteid = nominations.recordid
GROUP BY leadervotes.voteid, leadervotes.votedate, nominations.astname
HAVING (leadervotes.votedate > CONVERT(DATETIME, '2013-07-31 00:00:00', 102))
ORDER BY leadervotes.voteid DESC