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!

Identifying Clients with Special Characters

Status
Not open for further replies.

Tepzepi

Technical User
Sep 29, 2000
19
US
Hi,

I'm trying to write a report to identify all client names that have a special character such as and ampersand or underscore etc.Unfortunately, I have no programming knowledge, hence I don't know how to write a formula to use as a filter (which I am assuming is the route to go). Any assitance would be appreciated.

Regards

Warren I'd rather be stupid for 5 minutes than for the rest of my life.
 
there is no real way to "filter" these out in the record selection but they can be identified later

Set up the report such that you group on the client name...You have not shown me a sample of the name format but I will assume that it is the standard LastName Firstname format

So your group formula would be

@group

{table.Lastname} + " " + {table.firstname}

In the detail section put the two fields

{table.Lastname} {table.firstname}

In the conditional suppress formula for the detail section in the section expert...plac this formula

WhilePrintingRecords;
BooleanVar Suppressflag := True;
numberVar i;
stringVar testname := {table.Lastname}+{table.firstname};

for i := 1 to Length(testname) do
(
if not((asc(testname) in 65 to 90) or
(asc(testname) in 97 to 122) ) then
(
Suppressflag := False;
exit for;
);
);

Suppressflag;

this should do the trick....it will identify all names that has any character other than "a to z" and "A to Z"

hope this helps

Jim

JimBroadbent@Hotmail.com
 
Hi Jim,

Thanks for your prompt & concise response.

Unfortunately, I'm still presented with all the names. To confirm your instructions:
I inserted a group on the field name (single field, is abbreviated name of business).
Field already existed in report in details section.
Placed your formula in conditional suppress,details section.

Previewing the report shows all names in group, which are all names in database.I reconfirmed that I do in fact have data with special characters e.g John & Jack Stores, Smart-Mart Inc, etc.

Have I missed an obvious step?

Regards,

Warren

I'd rather be stupid for 5 minutes than for the rest of my life.
 
ok...now we know the format of the name as a single field the formula modifies to the following

WhilePrintingRecords;
BooleanVar Suppressflag := True;
numberVar i;

for i := 1 to Length(table.clientname) do
(
if not((asc({table.clientname}) in 65 to 90) or
(asc({table.clientname}) in 97 to 122) ) then
(
Suppressflag := False;
exit for;
);
);

Suppressflag;

SORRY...I had forgotten to analyze each separate character
this should do it now hopefully

Jim

JimBroadbent@Hotmail.com
 
I'll try this again...this text is being interpreted as fonts when I use "i" as a variable

WhilePrintingRecords;
BooleanVar Suppressflag := True;
numberVar icount;

for icount := 1 to Length(table.clientname) do
(
if not((asc({table.clientname}[icount]) in 65 to 90) or
(asc({table.clientname}[icount]) in 97 to 122)) then
(
Suppressflag := False;
exit for;
);
);

Suppressflag;

there that should be better

Jim

JimBroadbent@Hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top