Link to home
Start Free TrialLog in
Avatar of smithmrk
smithmrkFlag for United States of America

asked on

Sum ONLY Visable Fields

OK, So I have a FoxPro 9.0 Form and I have the box checked off under the field properties "Print When" tab to NO Print Repeated Values!

Works Great...however it still adds it as part of the Group Total.
How can I get the Group Total to ingore any Repeated Fields?

Thanks,
Mark
SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smithmrk

ASKER

OK, Thank You...but let me explain my situation better to get a better idea of where you are coming from.

I have an account number lets say 12345 that account number relates to two different people lets say husband and wife (join account)...I want to show BOTH names on the report but only show the amount paid once.

For Example:

12345     Joe Smith   $450.00
               Mary Smith

                         Total $450.00

What I'm getting is this:
12345    Joe Smith   $450.00
              Mary Smith

                       Total $900.00

I want to only add the amount once based on the account number only showing once.
Like I said I'm hiding the account number and same payment amount by using the Print When Option.

If there is a way to do it using the SQL Statement I'm open to that as well.
I'm currently joining the Payment Table with the single account number and payment amount to the name table where I find account number and match it up to all the names on the account.

Thanks,
Mark
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Guys!
Both of you were very helpful and I ended up doing it this way:

Olaf_Doschke is right I've had issues in the past with "Print When"...however I decided to do it like this...

I setup two variables in the report and put logic behind it as pcelba suggested:
One called SeqNum and then I calculated the amount using this logic:
IIF(p1_seq_num=SeqNum,0,appl_amt)

My thought process was that I would grab the SeqNumber of the item and if it was the same as the previous one I would zero out the amount if the SeqNumber was different than the previous one I would add to the Amount.

I could have also done this in the SCAN as pcelba also suggested, but it seems to work this way as well in the report using the Report Variables.

Thanks to both of you and I gave some points to Olaf_Doschke for helping with the question!  I appreciate both of you taking the time to help me through my issue.

Until next time...there will surely be a next time!
Mark
You are welcome.

And yes, I have to confirm the SCAN works similar way as report variables in this case. Report variables just do the work on the fly.