|
 |
asp_databases thread: SV: SV: Vote System, probs again =)
Message #1 by =?iso-8859-1?Q?H=E5kan_Frennesson?= <hakan@c...> on Fri, 5 Oct 2001 22:33:45 +0200
|
|
Hi!
Did you look at my earlier suggestions? You don't seem to try them.
You have to use a aggregate function when grouping, otherwise there is no
point in doing it, so please look at my suggestions. Use the function AVG on
each field that contain numeric values ie graphics etc.
Select AVG([graphics]), AVG([etc etc... FROM bla GROUP BY blabla HAVING bla
Hakan
-----Ursprungligt meddelande-----
Från: SD-Studios [mailto:info@s...]
Skickat: den 4 oktober 2001 18:12
Till: ASP Databases
Ämne: [asp_databases] SV: Vote System, probs again =)
Now what's wrong then? =)
SQL2 = "SELECT graphics, sound, gameplay, overall FROM vote GROUP BY gameid
HAVING gameid = '" & objRS("gametitle") & "'"
Error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that
does not include the specified expression 'graphics' as part of an aggregate
function.
--
Martin Johansson
-----Ursprungligt meddelande-----
Från: David Cameron [mailto:dcameron@i...]
Skickat: den 4 oktober 2001 01:28
Till: ASP Databases
Ämne: [asp_databases] RE: SV: RE: Vote System, probs again =)
I agree about the option explicit. Before I started using it I found that I
used to misspell variables and get inexplicable results. It is much easier
to use option explicit and get an intelligent error message than to hunt
through 1000 lines of code to find the error. Having all variables declared
also helps to keep track of them.
regards
David Cameron
nOw.b2b
Message #2 by "Dallas Martin" <dmartin@z...> on Fri, 5 Oct 2001 17:43:41 -0400
|
|
SQL2 = "SELECT graphics, sound, gameplay, overall FROM vote GROUP BY gameid
HAVING gameid = '" & objRS("gametitle") & "'"
Should be
Sql2 = "SELECT graphics, sound, gameplaly, overall, count(*) AS VOTES FROM
vote WHERE gameid = " & objRS("gametitle)"
"HAVING" is usuall used to evaluate the AGGREGATE functions:
"HAVING count(*) > 10"
Dallas
----- Original Message -----
From: "Håkan Frennesson" <hakan@c...>
To: "ASP Databases" <asp_databases@p...>
Sent: Friday, October 05, 2001 4:33 PM
Subject: [asp_databases] SV: SV: Vote System, probs again =)
> Hi!
>
> Did you look at my earlier suggestions? You don't seem to try them.
> You have to use a aggregate function when grouping, otherwise there is no
> point in doing it, so please look at my suggestions. Use the function AVG
on
> each field that contain numeric values ie graphics etc.
>
> Select AVG([graphics]), AVG([etc etc... FROM bla GROUP BY blabla HAVING
bla
>
> Hakan
>
>
|
|
 |