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!

compare name fields and return mismatches only

Status
Not open for further replies.

RepRider

Technical User
Jan 25, 2007
114
US
I have ONE table where there are 3 independent name fields:
name (lastname, first name)
lname (last name)
fname (first name)

I am looking for ALL mismatches whatever they are.

Using Crytal Reports XI will the following work (research for a friend)?

{TABLE1.NAME} <> {table1.lname} + " , " + {table1.fname}

How do I compare these fields and only show the mismatches between the name field and the combined fname and lname?

Thanks if advance.



 
you could use something like you have, changed a bit, like below.
it will put a 0 if they match and a 1 if they do not. you can then suppress all the records where it is zero using the section expert.

{@zeroistrue}
IF {table1.name} = {table.lname} & ", " & {table.fname}
then 0
else 1;
 
a second thought....

depending on how the data is stored, it may have trailing spaces, you may need to trim the fields.

TRIM({table1.name}) = TRIM({table.lname}) & ", " & TRIM({table.fname})
 
I wonder if any of these fields can be null?

-LB
 
I think you should be able to use your formula as a selection formula:

{TABLE1.NAME} <> {table1.lname} + ", " + {table1.fname}

...but make sure that you have the spaces around the comma match the way the name is displayed in {table1.name}.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top