Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nested if formula

Status
Not open for further replies.

ABetha

Programmer
Jul 14, 2010
35
US
I am trying to summarized a nested if formula I am not getting the numbers that I am looking for.

I believe that I am on the right track with this

if {@outofWarranty} = 0 and {@DuplicateRep 2} = 0 and {@Hours } = 0 and {@visit} = 0 then
1
else
0

here are the contents of the following formulas
{@outofWarranty}
if {@warrend} < {vSerialNo.Date} then
formula = 1
else
formula = 0
end if

{@DuplicateRep 2}
if not onfirstrecord and {vSerialNo.Date} = previous({vSerialNo.Date}) and {@DuplicateRep} = "dup" then
1
else
0

{@Hours}
if val({vSerialNo_Operation})>= 1 then
formula = 0
else
formula = 1
end if

{@Visit}
if ({vSerialNo.ReportDate}-{vSerialNo.Date} >= 180) then
formula = 1
else
formula = 0
End if


I then want to take a total of the credit
I then use the three formula structure
Summary Formula

whileprintingrecords;
numbervar Sumcredit;
if {@outofWarranty} = 0 and {@DuplicateRep 2} = 0 and {@Hours } = 0 and {@visit} = 0 then
Sumcredit :=Sumcredit + 1 ;

Display
WhilePrintingRecords;
numbervar Sumcredit;

Reset
WhilePrintingRecords;
numbervar Sumcredit;
if not inrepeatedgroupheader then
Sumcredit := 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top