Tips and Tricks
 Crystal Reports Forum : Crystal Reports .NET 2003 : Tips and Tricks
Message Icon Topic: Finding a specific number in a number field Post Reply Post New Topic
Author Message
Rodemusprime
Newbie
Newbie


Joined: 19 Aug 2010
Online Status: Offline
Posts: 10
Quote Rodemusprime Replybullet Topic: Finding a specific number in a number field
    Posted: 11 Feb 2013 at 5:19am
I have a field NUMBERS. that contains phone numbers.  I need a formula that will search for the 4th number in that field, and if that number is either a "0" or a "1", I need it omitted.  Otherwise I want the number shown.

EX:

2120111234
2121111234
2125551234

I do not want my report to display the first 2 numbers. 
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 21 Feb 2013 at 12:55pm
I think this is what you need in the suppress formula of the fields.

If mid(totext({NUMBERS}),4,1) = "0" or mid(totext({NUMBERS}),4,1) = "1" then true else false.

I have not tested this formula.  Basically we are converting the number to a text (I am assuming we are working with a numeric field) and checking the fourth character to see if it is a zero or a one.  If so, then return a true condition else a false condition.  A true condition in the suppress formula for a field will suppress the field.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.