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

supressing based on value entered

Status
Not open for further replies.

andreadd

MIS
Jan 15, 2008
67
Environment: SQL2000 SP4, Goldmine 6.7, Crystal Visual Advantage 2008

So I am writing this report that looks at my SQL tables and returns a red "x" if data is totally missing and a green check if data is present. I am using the graphics themselves and putting in the format / suppress area to suppress if data is missing. I now want to add a new graphic for my data slobs that do not enter the entire value or enters in something totally wrong.

for example i have a field that is a text field but is for numeric values only. I am using this formula to supress the graphic: numerictext({CONTACT1.KEY1}) or isnull({CONTACT1.KEY1})

so if there is numeric only or if it is empty then it supresses otherwise it is visible. works great.

i now want to go after 2 more items and am having a total brain fart.

i need to have my graphic suppress for email if there is no email address or if it has the "@" symbol in there. (my users biggest typo) So I want my bad data graphic to show IF the "@" is not present.

the other thing i need for my graphic to do is suppress if my zipcode is bigger than 5 digits. so the green check is for stuff in there, the red "x" is for missing zip and the bad data graphic is if there are fewer than 5 digits.

any ideas? (both fields - email and zip are string fields)

thanks
 
I figured out the zipcode one:

Length ({CONTACT1.ZIP}) >= 5 or {CONTACT1.ZIP} = ''

now I need to figure out the crystal equivalent of 'does not contain'
 
Hi,
Try

Trim({EMAIL}) = "" or InStr({EMAIL},"@") < 1

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Note that null checks must ALWAYS come first, and you might want to check for both nulls and blank fields:

isnull({CONTACT1.KEY1}) or
trim({CONTACT1.KEY1}) = "" or
numerictext({CONTACT1.KEY1})

-LB
 
I did not know that about the Nulls - thanks for the tip. I really appreciate it.

Turkbear I tried InStr({EMAIL},"@") < 1 on my bad data email icon and it didnt supress at the right times and when I checked the raw data the "@" was there for when the icon appeared on the report. What am I doing wrong?

Also, I am hoping to do a cascading parameter that will allow the users to select to search by city or by zipcode and change my record selection based on what they pick.
I just started staring at this and have the phone ringing off the hook and no sugar or enough caffeine going thru my veins right now so I am having massive brainfarts. any help would be greatly appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top