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

counting no matches

Status
Not open for further replies.

Alincon2001

Programmer
May 16, 2001
22
US
I have a file of tenants with project number, and another file of tenants with ethnic codes.
Mgmt has requested a report showing the number of tenants in each project, and the number and percent of tenants that have a record in the ethnic code file.
If I link the files on tenant id# (the only common field), all I get is the number of tenants that have a record in the ethnic code file.
I need to count the no matches, too.
 
You will need to do an outer join from tenants to ethnic codes. What is your database platform? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
I am using a data-flex database.
I am using CR 7, standard (no sql)
 
I have never used CR with DataFlex. I thought that was for mini-computers. Does that have an ODBC driver?

When you link the tables together do you see the indexes highlighted with colored tabs?
Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
I've used reports from the ODBC drivers with Dataflex, and the ODBC and joins didn't make like helpful.

1) Do your report from the Tenants in each project. Count the tennants in each project.
2) In a subreport look up all the tennants and their enthic codes, and count these. Link the subreport bny the Project.
3) CR7 supports shared variables, so store the count in the subreport in a shared numbervar.
4) Place the subreport in Group Header 1a and underlay it with the other header stuff from GH1b.
5) In the main report, your formula is
Shared Numbervar MySubCount;
Count({tenants.name},{tenants.project}) % MySubCount
6) You might also need to set the counter to zero in case the subreport has no records for that project. Use...
Shared Numbervar MySubCount := 0
 
Thanks for your help.
I only got thru steps 1 and 2
How do I store the count in a shared variable?
BTW, the subreport counts are all zero.
What does "underlay it with the other header stuff" mean?
There is no project field in the ethnic file records.
r.m.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top