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];
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];