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

Partial string match 1

Status
Not open for further replies.

munchen

Technical User
Aug 24, 2004
306
GB
I am using version 8.5 and I am connecting via ODBC to a Microsoft Access database.

I have two fields on my report called CustomerName and CustomerAddress. However the customer address field on some occasions also contains the customer name on the first line before displaying the address:

Customer Name
J Bloggs
Cust Address
J Bloggs
10 New Rd
London

What I would like to do is to suppress the customer name field if the customer name is displayed in the customer address field. Not too sure which function I should use (instr,like, compare first so many characters of each string etc).

Hope someone can help.
 
Right click the customer name field and select format. The hit the X-2 button to the right of the suppress checkbox and enter a formula like this:

{CustomerName}={CustomerAddress}

This will suppress the field when it equals the address field. If this does not work for you then explain in more detail what you are trying to do.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
askdon@srhconsulting.com
 
dgillz

I've already tried that option and it didn't work.

Basically I've got two fields displayed in the report like so:

tblAuthorisations.Name
tblAuthorisations.Address

For some (not all) customers they for some reason (by mistake) have the name also displayed in the first line of the address field like so:

Joe Bloggs & Co Ltd
Joe Bloggs And Co Limited
10 New Road
London

So what i need to do is some kind of string compare, possibly using the first so many characters?

Hope this explains things better.
 
There's no surefire method, but try:

Right click the details and select insert section below

place the name in the details A, address in details B

Right click details b and select format section.

In the X 2 next to Suppress place:

not(isnumeric(left({table.address},1)))
and
uppercase(left({table.address},5)) = uppercase(left({table.name},5))

-k
 
thanks a lot synapsevampire

I didn't have to create any sections below I just right clicked on the name field and in the x next to suppress i used:

Left({tblAuth.Name},5)=Left({@tblAuth.Address},5)

This worked exactly as I wanted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top