Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 SQL to grab most active posts in the last month
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

CarKnee
Junior Member

USA
297 Posts

Posted - 04 August 2003 :  17:01:36  Show Profile  Visit CarKnee's Homepage
Hey everyone...
I am looking to pull the TOP 5 most replied to Topics that were started in the previous month.

I am too fried to get the correct SQL Statement tonight. Can someone lend a hand?

I need topic_ID, subject, member_name of topic starter and COUNT(# replies to topic)

Thanks,
CarKnee

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 04 August 2003 :  17:25:48  Show Profile  Visit D3mon's Homepage
Try something like this:

select      top 5
            topic_id,
            t_subject,
            m_name,
            t_replies
from        FORUM_topics ft
inner join  FORUM_members fm
    on      fm.member_id = ft.t_author
where       t_date like '200308%'
order by    ft.t_replies desc
Probably need to use ASP to build the date string first, format - yyyymm.
Works OK for SQL DB, might need advice on adapting for Access or MySQL though.


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

Edited by - D3mon on 04 August 2003 17:36:58
Go to Top of Page

CarKnee
Junior Member

USA
297 Posts

Posted - 04 August 2003 :  21:38:35  Show Profile  Visit CarKnee's Homepage
Thanks D3Mon.

It worked well.

CarKnee

Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 05 August 2003 :  03:05:18  Show Profile  Visit D3mon's Homepage
no problem.


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.61 seconds. Powered By: Snitz Forums 2000 Version 3.4.07