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

String Field with Wildcard Formula 1

Status
Not open for further replies.

FrankMhere

Technical User
Jul 2, 2007
4
0
0
US
I'm creating a report using Crystal 8. I have a String field but I wanted to create a formula using a Wildcard.

IF
({Field}) = "11-1111111" OR
({Field}) = "11-2222222" OR
({Field}) = "*0000*"
THEN 1 ELSE 0

I'm guessing that my issue has to do with the fact that the field is a String. Am I correct? Is there a way around this?

 
You need to use "like" with a wildcard. But do you mean that any field that contains four zeros in a row in any position should be counted?

IF
{table.Field} in ["11-1111111","11-2222222"] OR
{table.Field} like "*0000*" THEN
1 ELSE
0

-LB
 
That was EXACTLY what I was looking for. Thank you. The "LIKE" statement was what I was missing and did exactly what I wanted it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top