SUM values a query - novice question

S

sean

Hi there,

I have 3 tables tmpproductoptions, product_options, TaxRate. I am trying to
SUM the value in "OptionPrice" field and then multipy the total by the
TaxRate where the TaxRateID are the same.

1. I have tried to calculate the total in the recordset with the query below
2.I have tried a union on the query but was unable to retreive the value
from the results and display it.

Is there an easy way to this in one query ?

sean - thanks in advance

---- tables ----

tmpproductoptions product_options TaxRate
---------------- ----------------- -----------------
OptionID OptionID tblTaxRateID
OptionValue TaxRateID TaxRate
OptionPrice
OrderNumber

!---

PARAMETERS pOrderNumber Long;
SELECT [tmpproductoptions].[OptionID], [tmpproductoptions].[OptionValue],
[tmpproductoptions].[OptionPrice], [tmpproductoptions].[OrderNumber],
[product_options].[OptionID], [product_options].[TaxRateID],
[TaxRate].[tblTaxRateID], [TaxRate].[TaxRate]
FROM tmpproductoptions, product_options, TaxRate
WHERE [tmpproductoptions].[OrderNumber]=pOrderNumber And
[tmpproductoptions].[OptionID]=[product_options].[OptionID] And
[product_options].[TaxRateID]=[TaxRate].[tblTaxRateID];
 

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