Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: How do I use a Instr to check for a string value? Post Reply Post New Topic
Author Message
Database_Virgin
Newbie
Newbie
Avatar

Joined: 14 Jun 2011
Location: United States
Online Status: Offline
Posts: 2
Quote Database_Virgin Replybullet Topic: How do I use a Instr to check for a string value?
    Posted: 14 Jun 2011 at 8:13am
I have a field called status. I need to do a compare: if status is 'dead' then formula=false. if status is anything else, formula = true. There is a status value 'dead-spent'. I want the formula to be true when it's dead-spent but the way I have it written, it doesn't read past 'dead'. Does anyone know how i can differentiate the two? Status can have seven different values(active, inactive, etc....)
This is what i have so far & it's not working.
 
if instr({CUST.Status},"Dead",1)>0 then
    formula = false
else
    formula = true
end if
 
-Nancy.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Jun 2011 at 8:27am
just directly compare
 
NOT({CUST.Status}="Dead")
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 14 Jun 2011 at 9:07am
If both "dead" and "dead-spent" are statuses that should evaluate to True, then you can check for both.

Edited by Keikoku - 14 Jun 2011 at 9:08am
IP IP Logged
Database_Virgin
Newbie
Newbie
Avatar

Joined: 14 Jun 2011
Location: United States
Online Status: Offline
Posts: 2
Quote Database_Virgin Replybullet Posted: 15 Jun 2011 at 8:18am
I did a direct compare & it worked like a charm.
Thank You.
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.016 seconds.