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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MySql
 "Invalid use of group function"
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 10 February 2007 :  09:47:25  Show Profile  Send ruirib a Yahoo! Message
Well I don't know the mod nor the reason this code was written, so maybe you should stick to what works, regardless of whether the SQL is the best or not.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 10 February 2007 :  10:08:01  Show Profile  Send pdrg a Yahoo! Message
min is an Access aggregate function, it doesn't make sense in pure SQL to order by an aggregated field except in some very explicit circumstances (which Access/Jet) allows, but which most engines will squeal at (and usually with good reason).

Go to Top of Page

Panhandler
Average Member

USA
783 Posts

Posted - 10 February 2007 :  10:10:22  Show Profile  Visit Panhandler's Homepage
Thanks, you've helped out quite a bit.
The mod is "Event Calendar" by red1 and is pretty good (he annotated each block of code).
There was just this one little glitch that was also posted in the Mod help section but never completely resolved.

I installed this mod into a "5-in-1 Snitz Common Expansion" modified forum without much difficulty.
"Event Calendar" is available on SnitzBitz and it still has this little bug in it. Anyone searching for "invalid use of group function" should be able to get things straightened out pretty quickly now.
Thanks again.


"5-in-1 Snitz Common Expansion Pack" - five popular mods packaged for easy install
". . .on a mote of dust, suspended in a sunbeam. . ."
HarborClassifieds
Support Snitz Forums


Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 10 February 2007 :  12:17:50  Show Profile  Send ruirib a Yahoo! Message
You can try this, but make sure it shows the data you want

'Get the events from the database
strSql = "SELECT T.TOPIC_ID, " & _
                "T.FORUM_ID, " & _
                "T.CAT_ID, " & _
                "T.T_SUBJECT, " & _
                "T.T_AUTHOR, " & _
                "T.T_STATUS, " & _
                "E.EVENT_DATE, " & _
                "C.CAT_MODERATION, " & _
                "F.F_MODERATION " & _
        "FROM (((" & _
            strTablePrefix & "TOPICS AS T " & _
        "INNER JOIN " & _
            strTablePrefix & "CAL_EVENTS AS E ON T.TOPIC_ID = E.TOPIC_ID) " & _
        "INNER JOIN " & _
            strTablePrefix & "CATEGORY AS C ON T.CAT_ID = C.CAT_ID) " & _
        "INNER JOIN " & _
            strTablePrefix & "FORUM AS F ON T.FORUM_ID = F.FORUM_ID) "
        
Select Case strDisplay
    Case "future"
        strSql = strSql & "WHERE E.EVENT_DATE >= '" & DateToStr(DateValue(strForumTimeAdjust)) & "' "
    Case "past"
        strSql = strSql & "WHERE E.EVENT_DATE < '" & DateToStr(DateValue(strForumTimeAdjust)) & "' "
end Select

if intRqCalForumID <> 0 then strSQL = strSQL & _
            "AND T.FORUM_ID = " & intRqCalForumID & " "

strSql = strSql & "ORDER BY E.EVENT_DATE Asc, T.TOPIC_ID Asc"


set rs = Server.CreateObject("ADODB.Recordset")
rs.open StrSql, My_conn


This removes the second join with events date. If you still have repeated records, try adding the red part to the first statement:

strSql = "SELECT DISTINCT T.TOPIC_ID, " & _




Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Panhandler
Average Member

USA
783 Posts

Posted - 10 February 2007 :  15:20:07  Show Profile  Visit Panhandler's Homepage
Okay. I'll get to it later today or tomorrow.
Thanks.


"5-in-1 Snitz Common Expansion Pack" - five popular mods packaged for easy install
". . .on a mote of dust, suspended in a sunbeam. . ."
HarborClassifieds
Support Snitz Forums


Go to Top of Page

Panhandler
Average Member

USA
783 Posts

Posted - 10 February 2007 :  20:34:20  Show Profile  Visit Panhandler's Homepage
Your code change suggestions worked. The DISTINCT addition was not needed.

The Event Calendar mod isn't perfect yet. . .but it seems to be working along with the "5-in-1 Snitz Common Expansion Pack in a compatible manner.

I did the odd thing of scheduling an event in a Private Hidden forum, then attempted to change the topic to a public forum and it wouldn't do it. Nothing would change, but nothing was broken either.

So for all practical purposes, this thing ROCKS!
Thanks ruirib. ruirib ROCKS!
Obrigado.




"5-in-1 Snitz Common Expansion Pack" - five popular mods packaged for easy install
". . .on a mote of dust, suspended in a sunbeam. . ."
HarborClassifieds
Support Snitz Forums


Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 10 February 2007 :  20:39:32  Show Profile  Send ruirib a Yahoo! Message
Glad it worked .


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 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.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07