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

suppress if the 6th character equals -0- 2

Status
Not open for further replies.

Monkey820

Technical User
Dec 11, 2003
62
0
0
US
Hi There!

I need a formula to suppress the field if the 6th character in the field equals -0-. How do I formulate it to only look at that 6th character?

Any help is appreciated!

Thanks!

Micky
CRW 8.5
WindowsXP
 
In what sense is that the 6th character? It looks like characters 6,7 and 8 or maybe 5,6,7--or are you trying to mimic another odd character by using -0-? Try using the mid function:

mid({table.field},6,3) = "-0-" //if it is the 6th thru 8th

The first number shows the starting position, and the second indicates the number of characters.

-LB
 
The 0 is just a 0 , no dashes (sorry)
Your information helped! Thanks!
 
I tried {table.field} [6] = "0" and got a syntax error. What am I doing wrong?

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Hi,

Works for me..In the
Supress formula editor
Code:
{table.field} [6] = "0"
does supress the expected fields...




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Madawc: If you receive an error, post the specific error that you're getting.

I'd guess that you tried it against a non string field, or it's a memo field.

-k
 
Sorry, it was indeed non-string. The numeric code worked fine with Totext({Cusomter.CustNo}) [2]

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
OK - Now I need to suppress everything that does not start with 1, 2 or 3 in the first position of a string field.


Any help?

Micky
CRW 8.5
WINXPPRO
 
You could use a suppression formula of:

{table.field}[1] in ["1","2","3"]

Or, you could use:

left({table.field},1} in ["1","2","3"]

-LB


 
Will this suppress 1, 2 and 3? I need to see only 1, 2 and 3.
 
Sorry, I had it backwards:

not({table.field}[1] in ["1","2","3"])

OR, use:

not(left({table.field},1} in ["1","2","3"])

-LB
 
Ahh! I used
left({table.field},1) in ["1","2","3"]
and then got a true, false value, so I suppressed the false.

Is that an acceptable way to get my result or is it too messy?

 
Where are you using this? I meant for you to use this in the format field->common->suppress->x+2 formula area--assuming you want only to suppress the field itself. If you wanted to suppress the entire row, you would use the formula in the section expert->details->suppress->x+2.

-LB
 
Depending upon why you are doing this, you may want to consider putting the criteria in the select statement so that you only get the records that you want... where possible, let the database do the work for you - that's what it's designed for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top