Thanks Craig, that did it!

Robert

-----Original Message-----
From: Craig Dudley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 24, 2002 9:47 AM
To: CF-Talk
Subject: RE: Help From You SQL Gurus Out There


Try using GROUP BY as follows

<cfquery datasource="shared" name="Search">
        Select TOP 100 B.TopicID, B.ForumID,B.LastMessageDate
        From Messages A,Topics B
        Where a.isapproved = 'y'
                and B.TopicID = A.TopicID AND b.forumid = a.forumid
                AND DateDiff(d, A.MessageDate, #TDay#) < 3
                and (B.station='#thestation#' or B.station='ALL')
        Group By B.TopicID, B.ForumID,B.LastMessageDate
        Order By B.Lastmessagedate desc
</cfquery>

Should work


______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to