Avatar of George_Milton
George_Milton
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Crystal Reports

Hi. I have very little knowledge of crystal reports but was hoping someone could help with this. What I need to do is to create a formula that will match part of a reference and then enter text or number.
So reference is abc/12/1234562, I want crystal to match /12/ and then insert 2012 into the report. I have tried a few things in formulas such as wild cards, and so far no luck. The other issue is that the characters before and after the /12/ can vary.

Thanks in advance
Crystal Reports

Avatar of undefined
Last Comment
George_Milton

8/22/2022 - Mon
peter57r

Need more informatio on requirements.

Are you saying that your report should only contain records that have /12/ in this field?
Or are you saying that some records in the report will have this but others in the report will not have  /12/?

And are you saying you want the field to appear in the form..  abc/2012/1234562?

If this last bit is what you want then you just create a formula field that is...

replace({table.field}, "/12/", "/2012/")
George_Milton

ASKER
Hi, sorry for the lack of info.
What I have is a report that is produced, one of the fields is Year. Now unfortunately the DB does not produce the correct information. So I was trying to create a formula that would look at the field called reference, would then look for /10/ within that field and then output into the report as 2010. I do the same with another fields, that just contains 3 letters, so I have an if statement that looks at the field and =abc then totext testabc, I just don’t know how to tell crystal to only check for the /10/ and if that matches then totext 2010, and so on for /11/, /12/ etc.. I hope that make sense

Thanks
SOLUTION
Mike McCracken

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
George_Milton

ASKER
Hi

I just want the year field to show 2012. Do not need any of the reference so, for example abc/10/123456 as /10/ is present the report will show 2010. Again apologies as I no real knowledge of Crystal
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
George_Milton

ASKER
Hi
Thanks that works, thank you very much, now if only I understood what it was doing!!!!

Again thanks very much