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

variables

Status
Not open for further replies.

grierfield

Technical User
Dec 18, 2002
55
US
I create a Variable eg
StringVar Surgery := {profile. Surgeon};
if surgery <> &quot;&quot;
Then &quot;T&quot;
Else
&quot;F&quot;
//the column Surgeon list surgeon names where available, where there the surgeon field is blank I expect the variable SURGERY to return an F, it returns nothing.
what am I doing wrong?
 
I don't think you need a variable here. You could just create a formula like this:

if isnull({profile.surgeon}) or
{profile.surgeon} = &quot;&quot; or
{profile.surgeon} = &quot; &quot; then
&quot;F&quot; else &quot;T&quot;

-LB
 
It's generally simpler to reverse this logic:

If {profile.surgeon}) = &quot;T&quot; then
&quot;T&quot;
else
&quot;F&quot;

And make sure it it isn't a boolean, if it is, use

If {profile.surgeon}) = .T. then
&quot;T&quot;
else
&quot;F&quot;

-LB
 
Hmmm--

What a day (or two). I've had a thread I wrote claimed by someone else and now my signoff is being adopted by someone else. This possibly throws my existence into question.

SV - Your solution won't work for nulls though, I don't think.

-LB
 
LB, thanks a lot, that was great the first one with the isnull worked perfectly, dont know how it works but it did. I will try the others later and see if they are good alternates. guess i'll have to send the site a few $$. thanks again
 
If {profile.surgeon}) = &quot;T&quot; then
&quot;T&quot;
else
&quot;F&quot;

And make sure it it isn't a boolean, if it is, use

If {profile.surgeon}) = .T. then
&quot;T&quot;
else
&quot;F&quot;

these solutions did not work - i thought the first one would - any reason u think why they didnt work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top