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

Searching array data

Status
Not open for further replies.
Apr 25, 2007
14
US
Hi all,

I have a list of customers with their name, tel, work_tel, employer_name, employer_addess in a excel file.

This report will pull all customer information and hightlight their employer name if it is same as the one in our database (customer.emp_name).

The problem is the employer name field in free-form filed so a name could be entered in different way.
So I'd like to if the name is similar w/ the one in our database then I want to highlight it as well if it's possible.

Is there anyway to make array formular for the employer name and everytime it reads employer name from our database compare a employer name from the array field and highlight it if it's same or similar with the one in our database?

Thank you very much for your help in advance.
 
I don't think an array is the best method. Set up a formula field, using LIKE. HELP for Crystal 10 explains the function:
Code:
{customer.LAST NAME} like "*s?n*"
TRUE, where {customer.LAST NAME} = Johnson or Olson or Olsen.

You can have several of these tests in the one formula. Put the formula field beside the raw data and let it display True or False. Once you have got it doing what you want, put the name of the formual field in the record selection, which means records will be selected where it is True.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks Madawc,

since i need to lookup data value customer.emp_name to see if there is anything same or similar to values in employer_name field from excel spread sheet, I am not sure how i'm going to use "like".

for example,
a formula
{customer.emp_name} like "*{sheet1.employer_name}*"

will not work properly.

Please advise if i'm missing something here.
Thanks a lot.
 
You will have to decide what you mean by "similar". If you think you can identify most similar names without too many incorrect returns by using, for example, the first 3 letters of one field, you could do that:

{customer.emp_name} like "*"+left({sheet1.employer_name},3)+"*"

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top