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

Suppressing empty space in a text field.

Status
Not open for further replies.

rnd

Programmer
Jun 30, 2001
44
US
Is there any way to suppress an empty space in a text field or a database string (varchar) field that contains some blank spaces in the middle ?
Database: SQL Server 2000. Crystal Decisions: 8.5 / 9

Ex:
The database text field will look like this.


The above one or two line spaces are the spaces I
want to get rid off. These extra spaces are
intentionally created by the data entry person by
pressing the "Enter" key for visual clarity between the
description and some additional description added on in
this case. But these extra spaces should not appear in
the CR.

Hope the example text explains the problem. The entire example text is in one direct database field (such as NAME.Description - NOT A CONCATENATION OF TWO DIFFERENT FIELDS or a formula).
Please help if you know the solution.
Thanks in advance.
 
Database: SQL Server 2000. Crystal Decisions: 8.5 / 9

I'd do this on the database side, but in CR 9 you can use a Replace fundtion against the field:

Replace ({table.field}, chr(13), " ")

You may be able to change the " " to "" if they do not use carriage returns elsewhere.

Crystal 8.5 cannot work with fields over 254 in length, so for that side I'd fix it on the database side using a View.

-k
 
Thanks a lot. It worked well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top