G
Geel
SELECT Contract_savings.Savings_ID, Contract_savings.Contract_ID,
Contract_savings.Opco_ID,
Sum([BenefitsTOSperiode].[SAVtotal]/[BenefitsTOperiode].[PVtotal]) AS
SumOfPVSum
FROM BenefitsTOperiode INNER JOIN (BenefitsTOSperiode INNER JOIN
Contract_savings ON (BenefitsTOSperiode.Opco_ID =
Contract_savings.Opco_ID) AND (BenefitsTOSperiode.Contract_ID =
Contract_savings.Contract_ID)) ON (BenefitsTOperiode.Opco_ID =
Contract_savings.Opco_ID) AND (BenefitsTOperiode.Contract_ID =
Contract_savings.Contract_ID)
WHERE (((BenefitsTOperiode.PVtotal)>0))
GROUP BY Contract_savings.Savings_ID, Contract_savings.Contract_ID,
Contract_savings.Opco_ID;
I've got an issue with dividing by 0. I'm actually calculating a
percentage for every record, if 1 of the total PV of total SAV is 0 the
outcome has to be 0 or n.a. or atleast work.
Anybody have a clue besides entering a different PV or SAV value then 0
(f.e. 0,0001)?
I tried fixing this by the above WHERE statement, but this way the
record won't show up at all and then because of the INNER JOIN in the
total query the complete record will not show up. So this ain't the
solution yet.
Contract_savings.Opco_ID,
Sum([BenefitsTOSperiode].[SAVtotal]/[BenefitsTOperiode].[PVtotal]) AS
SumOfPVSum
FROM BenefitsTOperiode INNER JOIN (BenefitsTOSperiode INNER JOIN
Contract_savings ON (BenefitsTOSperiode.Opco_ID =
Contract_savings.Opco_ID) AND (BenefitsTOSperiode.Contract_ID =
Contract_savings.Contract_ID)) ON (BenefitsTOperiode.Opco_ID =
Contract_savings.Opco_ID) AND (BenefitsTOperiode.Contract_ID =
Contract_savings.Contract_ID)
WHERE (((BenefitsTOperiode.PVtotal)>0))
GROUP BY Contract_savings.Savings_ID, Contract_savings.Contract_ID,
Contract_savings.Opco_ID;
I've got an issue with dividing by 0. I'm actually calculating a
percentage for every record, if 1 of the total PV of total SAV is 0 the
outcome has to be 0 or n.a. or atleast work.
Anybody have a clue besides entering a different PV or SAV value then 0
(f.e. 0,0001)?
I tried fixing this by the above WHERE statement, but this way the
record won't show up at all and then because of the INNER JOIN in the
total query the complete record will not show up. So this ain't the
solution yet.