Dear all
I have a field " LtrsConsumed" on
InvoiceTBL contains consumed water liters No. .....
Where consumption price in groups as:
1 to 200 liter * 1.5 Rials
201 to 500 liter * 2.0 Rials
501 to 1000 liter * 2.5 Rials
1001 to 2000 liter * 3.0 Rials
More than 2000 liter * 3.5 Rials
Stored in GroupPriceTBL.
Exampe :
Customer 1 has consumed 1200 liters
The Total consumption value :
(200*1.5) +
(300*2) +
(500*2.5) +
(200*3)
=
2750 Rials
How to calculates this in a query by using (iif) fun. to distribute ( 1200) consumed liters , on the prices in the GroupPriceTBL ?
I have a field " LtrsConsumed" on
InvoiceTBL contains consumed water liters No. .....
Where consumption price in groups as:
1 to 200 liter * 1.5 Rials
201 to 500 liter * 2.0 Rials
501 to 1000 liter * 2.5 Rials
1001 to 2000 liter * 3.0 Rials
More than 2000 liter * 3.5 Rials
Stored in GroupPriceTBL.
Exampe :
Customer 1 has consumed 1200 liters
The Total consumption value :
(200*1.5) +
(300*2) +
(500*2.5) +
(200*3)
=
2750 Rials
How to calculates this in a query by using (iif) fun. to distribute ( 1200) consumed liters , on the prices in the GroupPriceTBL ?