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

Formula for a formula

Status
Not open for further replies.

mjstanton

Technical User
Aug 28, 2001
107
US
I have very limited experience with Crystal Reports, so I need some help. I am creating a report which requires a zip code field with only 5 digits. Many of our clients in the database have the zip + 4 zip code. I have written a formula to just extract the first 5 digits (formula name is @zip). But now I need another formula, which would say "if @zip = "" then "12345" else @zip". Can I do this? And if so, where do I put this second formula?

Thanks in advance for any/all replies!!

MJ

 
Hi,
1:Yes you can..
2:place that formula where you want it to display (You need not display the original one, just the new one)




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Dear MJ,

Why not combine it all in one formula, this would be more efficient.

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Thanks, Turkbear - I tried that, and it didn't work.

Thanks, Rosemary, how would I do that? As I said, my CR experience is very limited. Right now my first formula is:

{View: Career Builder.reqzip<String>} [1 to 5]

Thanks!
MJ

 
Dear Mj,

I assume that if it is null, it is returning the ''.

So, try this:

If isnull( {View: Career Builder.reqzip<String>})
then '12345'
else
{View: Career Builder.reqzip<String>} [1 to 5]


hth,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Ro,

That works great!!! Thanks so much, I really appreciate the help!

MJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top