
Signature
KARL DEWEY
Build a little - Test a little
> I am trying to do a conditional avg in my report footing. I would
> like to avg values that are on the same row as an item between 7000
[quoted text clipped - 14 lines]
>
> any ideas would be appreciated.
On Jun 15, 2:39 pm, KARL DEWEY <KARLDE...@discussions.microsoft.com>
wrote:
> What is the name of the second field?
>
[quoted text clipped - 22 lines]
>
> > any ideas would be appreciated.
Sorry, the first field i am avg is the RPM field, the next field would
work like this(if this code actually worked like i would like it to)
=IIf(([RPM]>7000) And ([RPM]<9000),Avg([Power]),0)
or
SUM(iif(([RPM]>7000) And ([RPM]<9000),[Power],0))/SUM(iif(([RPM]>7000)
> > And ([RPM]<9000),1,0))
KARL DEWEY - 15 Jun 2007 20:58 GMT
Try this --
SELECT Avg(YourTable.RPM) AS AvgOfRPM, Avg(YourTable.Power) AS AvgOfPower
FROM YourTable
WHERE (((YourTable.RPM) Between 7000 And 9000));

Signature
KARL DEWEY
Build a little - Test a little
> On Jun 15, 2:39 pm, KARL DEWEY <KARLDE...@discussions.microsoft.com>
> wrote:
[quoted text clipped - 33 lines]
> SUM(iif(([RPM]>7000) And ([RPM]<9000),[Power],0))/SUM(iif(([RPM]>7000)
> > > And ([RPM]<9000),1,0))