Re: Sorting a recordset by a sum

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Jagno" <TheFetts@xxxxxxxxx>'s wild thoughts were released
on 31 Jul 2006 12:22:34 -0700 bearing the following fruit:


Jeff Johnson wrote:
<TheFetts@xxxxxxxxx> wrote in message
news:1154371843.248637.102690@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Initially I tried using a similar solution to get it to work, but since
you can't use the * like this: SELECT SUM(round1+round2) as Total, *
FROM ...
it ended up making the rest of the page much more complex.

Try an alias:

SELECT SUM(c.round1 + c.round2) AS Total, c.*
FROM competitordata c

Gave a similar error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Cannot group on fields
selected with '*' (c).

Do you have a GROUP BY in your SQL?


Jan Hyde (VB MVP)

--
To a mechanic, coffee is often brake fluid. (Jumble)

.