Solved

How to filter segments of text in Crystal 2008

Posted on 2011-09-07
5
207 Views
Last Modified: 2012-05-12
My filtering based on the previous question has changed and for some reason I am unable to figure out how to tweak this formula to make the filter do what I need.

Basically, I need to now filter out any employee ID that starts with 804 or contains 804. I also need to filter out any Emp Ids that have an 'S' as the last character in the string.. e.g. 12S, 134S, 2S. Based on my information this part of the filter can basically filter out any ID that contains an 'S'.

Thanks a bunch for the help.. I thought the formula I had changed would work fine for this..  (Here is what I tried;)

Right({BAQReportResult.EmpBasic.EmpID},1) <> 'S'
or
{BAQReportResult.EmpBasic.EmpID} <> '*804*'


I tried a few other variations but nothing seems to be working..
0
Comment
Question by:SeyerIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 36499296
Try it this way

Right({BAQReportResult.EmpBasic.EmpID},1) <> 'S'
AND
{BAQReportResult.EmpBasic.EmpID} <> '*804*'

Unless you have 804S it will always not equal one of them

mlmcc

0
 
LVL 19

Accepted Solution

by:
GJParker earned 500 total points
ID: 36501190

This should do the trick and will always be passed to the db in the SQL where clause

Not({BAQReportResult.EmpBasic.EmpID} Like '*S')
AND
Not({BAQReportResult.EmpBasic.EmpID} Like  '*804*')

HTH

0
 
LVL 2

Author Closing Comment

by:SeyerIT
ID: 36502224
Mlmcc, the method you posted was actually the last method I had before I quit trying.. To me, this should have worked but didn't. I thought I understood this filtering correctly but something about that formula (or any of the other ones I seemed to be trying) just wasn't working..

This other formula using "like" did the trick though.

Thanks for both of your guys' help though! I really appreciate it. This one was going to drive me crazy!
0
 
LVL 19

Expert Comment

by:GJParker
ID: 36502517
= and <> don't use wildcard characters so <> '*804*'will pull back everything that doesn't eaxctly match the search string, that's why you need to use the Like operator
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 36502753
I saw you needed AND and didn't look at the rest.  The RIGHT part works it is the LIKE that was needed.

mlmcc
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question