Mark01
asked on
Incorrect Result from Formulas
I added five new formulas to a report (Daily_Dosage3b) and the results of the original three formulas on the new
report are different than on the original report (Daily_Dosage3a) that has only the original three formulas. Please
help me resolve the error. Why do the original formulas have a different result on the new report (Daily_Dosage3b)?
New formulas:
LowerTestResult = global numbervar LowerTestResult;
if {Test_Date.TestDate} = {?From Date} then
LowerTestResult := LowerTestResult + {Aspirin_Test.Reading};
LowerTestResult
UpperTestResult = global numbervar UpperTestResult;
if {Test_Date.TestDate} = {@ToDatePlusDay} then
UpperTestResult := UpperTestResult + {Aspirin_Test.Reading};
UpperTestResult
ToDatePlusDay = DateAdd (“D”,1,{?To Date})
TestResultDiff = {@UpperTestResult} - {@LowerTestResult}
Original formulas:
testAverageDosage = if not({@testDosageCount}=0) then {@testDosageAmount}/{@test DosageCoun t}
else 0
testDosageAmount = global numbervar dosageAmount;
if {Test_Date.TestDate} >={?From Date} and {Test_Date.TestDate} <= {?To Date} then
dosageAmount := dosageAmount + {Aspirin_Dosage.Dosage};
dosageAmount
testDosageCount = global numbervar dosageCount;
if {Test_Date.TestDate} >={?From Date} and {Test_Date.TestDate} <= {?To Date} then
dosageCount := dosageCount + 1;
dosageCount
Daily_Dosage3a.rpt
Daily_Dosage3b.rpt
report are different than on the original report (Daily_Dosage3a) that has only the original three formulas. Please
help me resolve the error. Why do the original formulas have a different result on the new report (Daily_Dosage3b)?
New formulas:
LowerTestResult = global numbervar LowerTestResult;
if {Test_Date.TestDate} = {?From Date} then
LowerTestResult := LowerTestResult + {Aspirin_Test.Reading};
LowerTestResult
UpperTestResult = global numbervar UpperTestResult;
if {Test_Date.TestDate} = {@ToDatePlusDay} then
UpperTestResult := UpperTestResult + {Aspirin_Test.Reading};
UpperTestResult
ToDatePlusDay = DateAdd (“D”,1,{?To Date})
TestResultDiff = {@UpperTestResult} - {@LowerTestResult}
Original formulas:
testAverageDosage = if not({@testDosageCount}=0) then {@testDosageAmount}/{@test
else 0
testDosageAmount = global numbervar dosageAmount;
if {Test_Date.TestDate} >={?From Date} and {Test_Date.TestDate} <= {?To Date} then
dosageAmount := dosageAmount + {Aspirin_Dosage.Dosage};
dosageAmount
testDosageCount = global numbervar dosageCount;
if {Test_Date.TestDate} >={?From Date} and {Test_Date.TestDate} <= {?To Date} then
dosageCount := dosageCount + 1;
dosageCount
Daily_Dosage3a.rpt
Daily_Dosage3b.rpt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get an error when I change the join to the aspirin test table to LEFT OUTER. I will post a new question when I have more time to work on this report. Thank you, mlmcc.
ASKER