Multiplying in a Query

L

Lina Manjarres

I have a table with the following data:

IdStbd IdIndctr Index
1 1 1.1
1 2 1.2
1 3 1.3

I need to have a query that take the Index numbers and multiplied them.
I won't know how many indexes I will have.

How can I do that?

Thanks a lot!!
Lina
 
P

pietlinden

I have a table with the following data:

IdStbd IdIndctr Index
1 1 1.1
1 2 1.2
1 3 1.3

I need to have a query that take the Index numbers and multiplied them.
I won't know how many indexes I will have.

How can I do that?

Thanks a lot!!
Lina

you mean you can't use a totals query and just use Count()?
 
J

John Spencer

Add the log of the index and then convert that back into a number.

SELECT Exp(Sum(Log(Index))) as IndexProduct
FROM YourTable

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
L

Lina Manjarres

I do not really know what you mean.
What I need is to multiply =1.1 * 1.2 * 1.3

Thanks a lot, Lina
 
J

John Spencer

Forgot to mention that all the values must be a positive non-zero value - no
nulls, no zeros, no negative numbers.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
L

Lina Manjarres

Hey John, you are a genious!!
Thanks a lot!!

John Spencer said:
Forgot to mention that all the values must be a positive non-zero value - no
nulls, no zeros, no negative numbers.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top