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

How do I seek fields?

Status
Not open for further replies.

AtomCom

Programmer
Mar 6, 2001
5
0
0
GB
I am having a major problem with a report.

I have a list of customer and a list of contacts.

I want a report of all customers.

When Customer name field is blank I want to use the contact name field of the first contact. A customer can have more than one contact, and sometimes does not have a contact at all.

The customer and contact tables are linked with a 3rd table called xref. This table holds a list of contact customers.

Please can anyone help, I am going bold here....

Andy......
 
This will be tricky. Is this an SQL/ODBC or datafile database?

Is there a specific field value that identifies the first contact?

If you can do this it will involve linking customer to Xref and Xref to Contacts.
Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I am using a ODBC

The 3 tables do link...

Customers to Xref, Xref to contacts.

but this problem becuase there can be more than one contact to a customer.

There currently is no field to indentify it as the first record for that set of contacts.
 
If you can't identify the record with a specific value you will have to bring back all of them and sort to find the first. You can then only print the first.

Is there something that you can sort on to identify the first record? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
AtomCom: If your XRef table contains one or more contacts for each customer then a DistinctCount of customer will give this information to you. You then need to extract the DistinctCount of first contact where there is no customer but it is not from your explanation what is entered into XRef in the case of a blank customer name - is it the first contact and only one and how is that name differentiated from the next time you hit a blank customer name? David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
How do I get Crystal to print only the first ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top