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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula help.... 2

Status
Not open for further replies.

savok

Technical User
Jan 11, 2001
303
AT
I have a list of records, i suppress every customer that has a null last name, refer.answer = "T" and term2.idnumber is not empty. Now all I need to do is count how many records I have left for a grand total.

Formula...

WhilePrintingRecords;
NumberVar Counter;

if isnull({people.last_name}) or {refer.answer} = "T" or not isnull({term2.idnumber}) then
Counter:=Counter
else
Counter:=Counter+1


This gives me a wrong count because half the records have a null refer.answer. And it doesnt count null refer.answers only those that arent T.

So I tried using this formula...

if isnull({refer.answer}) then
Counter:=Counter+1
else
if isnull({people.last_name}) or {refer.answer} = "T" or not isnull({term2.idnumber}) then
Counter:=Counter
else
Counter:=Counter+1

This formula started counting the null refer.answers but it counts all of them, even those that have a matching term2.idnumber or a null last_name.

Anyone have any suggestions?

Thanks a lot
 
Forget making up these formula.
Just do you selection and then use the records function.
 
your conditions are all OR - are you sure about that?
If so, this should work...

If IsNull({people.last_name}) then Counter
Else If (Not IsNull({refer.answer})) and {refer.answer} = "T" then Counter
Else If Not IsNull({term2.idnumber}) then Counter
Else Counter := Counter + 1 Malcolm Wynden
Authorized Crystal Engineer
malcolm@wynden.net
 
Malcolm you da man!

thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top