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

Keeping user names together when entered differently 2

Status
Not open for further replies.

mitmat

IS-IT--Management
Mar 26, 2002
24
GB
Hi Guys

Reporting on a field that displays the user in 2 ways
I need to keep these together is this the right way to go about it, if so how would I add the rest of the users

If {TASKS.OPENBY} = ["Alex" , "Alex Mcknight"] then
"Alex"

Any help much appriciated

Matt
 
You could replace the {tasks.openby} field with a formula:

if ubound(split({tasks.openby})) > 1 then
split({tasks.openby}," ")[1] else
{tasks.openby}

The potential problem, of couse, is if you have more than one person with the same name. If you have some ID field that corresponds to each name, you could group on the name formula and then the ID field, and then drag the group name for name into the ID group header and suppress the unwanted sections. That would keep the names alphabetical but display a name for each person, even if there are two with the same first name. That is--if you intend to group by this field in the first place...

-LB
 
I don't think that you showed how the users are displayed, rather two seperate QUOTE delimited strings, which I assume is some interpretation of how the data is stored.

Correct LB's formula to:

if ubound(split({tasks.openby}," ")) > 1 then
split({tasks.openby}," ")[1] else
{tasks.openby}

Succesful posts tend to supply:

Crystal version
Database/connectivity used
Example data
Expected output

Not descriptions and interpretations of what is in the field.

So how does the field delimit the two different users?

LB inferred a space, in the formula supplied, if it isn't a space, replace the " " in the formula with the character which separates the 2 different values.

-k
 
Thanks synapsevampire.

In future will put more detail in.
This works a treat.
I did actually manage to solve another way using a group in Specified order (Crystal 11) but your way is better.
Just need to change to CAPS which I'm hoping I'll be able to work out myself.
Many thanks
Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top