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

Is it Possible to Trim a field? 4

Status
Not open for further replies.

MaryM

Technical User
Mar 27, 2001
8
IE
Almost 3000 entries in a field need trimming for sorting purposes. How does one go about it?
 
hello

could you provide more detail on this issue? When you say you want to trim a field, I am assuming that you are not talking about trimming spaces, but more of the field. Please clarify. E. McEvoy
Crystal Reports Consultant
emcevoy@crystalconsulting.ca
 
Hello, thanks for responding

I'd settle for spaces. e.g.
{Generic_Name}
"Apples"
" Apples "
" Apples"
"Oranges"
" Oranges "
"Oranges "
ad infinitum

I'm putting together a catalogue of geneic names of spare parts. Grouping is ok except it throws the sequence out where the above sort of thing happens.
 
I use trim to cut out any leading or trailing spaces and then I use Left({name},20) to get all my Client names to be trimmed to a readable length.


James Flowers
 
Thank you both. I do not know how to use the Trim function in this particular instance. Pointers in the right direction would be appreciated.
 
hi

to use the trim you would simply place your field inside the brackets
eg
trim({db.fieldname})

This will get rid of the spaces. E. McEvoy
Crystal Reports Consultant
emcevoy@crystalconsulting.ca
 
Hi, I had tried this before asking questions, but when I
use
Trim({db0123.Generic_Name})

the error message is "the result of selection formula must be a Boolean".

What exasperating step am I missing?
 
hi,

It seems that you may be placing this in the record selection formula, is this correct? Can you give me what you have in this entire formula that this Trim({db0123.Generic_Name}) is in?

E. McEvoy
Crystal Reports Consultant
emcevoy@crystalconsulting.ca
 
Hi

Yes I am placing it in record selection. There is no formula.
 
The Record Selection Formula wants a boolean result because its purpose is to determine whether to select the record for inclusion in the report. The formula text
Trim({db0123.Generic_Name})
produces a string, but doesn't tell Crystal whether to include the record or not.
It sounds like you want to group by a trimmed version of this field. If so, just create a new formula, plug this formula text in it, then use the new formula to group your report. Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top