Notices


Reply
 
LinkBack Thread Tools Display Modes

Old 06-19-2008, 02:04 PM   #1 (permalink)
Senior Member

Join Date: Sep 2006
Posts: 257
Rep Power: 3 jas. is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)

how to remove a string from a field?

We have a few old attribute descriptions that I'm needing to include on a report that have bits and pieces of annoying text in them from a very old coding system. For instance:

Category: Former Commitee
Description: Major Gifts Committee (Former)


I'm doing a report and I just want to remove the parenthetical piece. I know I could do a code like

if {field} = "Major Gifts Committee (Former)" then "Major Gifts Committee"

and do a bunch of else ifs depending on what all's in there. It's a relatively small report, so that's doable. But is there a way to just have it suppress that string in the field?

I suspect not. But I figured it would be worth it to see if you guys knew...
__________________
james andrews
manager of development services
philadelphia museum of art
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 06-19-2008, 02:18 PM   #2 (permalink)
Crystal Reports Guru

DrewAllen's Avatar

Join Date: May 2006
Location: Philadelphia, PA
Posts: 1,155
Rep Power: 4 DrewAllen is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- Information Edge (TIE)
- API/VBA

You can use the Replace() function to replace one string "(Former)" with another "" in an input string {field}. This would be reasonable if there is a very small set of such substitutions.

Drew
__________________
J. Drew Allen
Children's Hospital of Philadelphia

Crystal Reports and SQL Server Consultant

It is better to live your destiny imperfectly than to live an imitation of somebody else's life with perfection.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 06-19-2008, 02:36 PM   #3 (permalink)
Senior Member

Join Date: Sep 2006
Posts: 257
Rep Power: 3 jas. is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)

oh, yeah, that would obviously do the trick. Thanks!
__________________
james andrews
manager of development services
philadelphia museum of art
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 06-19-2008, 02:45 PM   #4 (permalink)
Crystal Reports Guru

DrewAllen's Avatar

Join Date: May 2006
Location: Philadelphia, PA
Posts: 1,155
Rep Power: 4 DrewAllen is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- Information Edge (TIE)
- API/VBA

Another option if the parenthetical string always appears as the last element in the string is to use the CharIndex() to find the first occurrence of the character "(" and Left() to pull everything up to that value.

Drew
__________________
J. Drew Allen
Children's Hospital of Philadelphia

Crystal Reports and SQL Server Consultant

It is better to live your destiny imperfectly than to live an imitation of somebody else's life with perfection.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 06-19-2008, 02:51 PM   #5 (permalink)
Crystal Reports Guru

DrewAllen's Avatar

Join Date: May 2006
Location: Philadelphia, PA
Posts: 1,155
Rep Power: 4 DrewAllen is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- Information Edge (TIE)
- API/VBA

Sorry, CharIndex() is a SQL function. In Crystal you would use InStr().

Drew
__________________
J. Drew Allen
Children's Hospital of Philadelphia

Crystal Reports and SQL Server Consultant

It is better to live your destiny imperfectly than to live an imitation of somebody else's life with perfection.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
format report


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Cheap Gas - Loans - Mortgage - Phoenix Landscaping
All times are GMT -6. The time now is 04:26 AM.

Miscellaneous


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by BBpixel Team 2008 :: jvbPlugin R1012.364.1

SEO by vBSEO 3.2.0 Copyright 2008 Blackbaud User SocietyAd Management by RedTyger
Inactive Reminders By Icora Web Design

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64