Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: ?? on if statement in formula Post Reply Post New Topic
Author Message
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Topic: ?? on if statement in formula
    Posted: 16 Oct 2013 at 3:35am
Hi

Try to do the following but is erroring out.

if {USER_DEFINED_DATA.ASSESSMENT_MONIKER} = "4D17FC8EFA484E8B884E5F1C9B3D55DB"

then

stringvar x;
numbervar start;
numbervar end;

 x:={USER_DEFINED_DATA.ASSESSMENT_DATA};
start:= instr(x,'@@T_400_ = ') + 12;
end := instr(x,'"@@T_501');
x:=mid(x,start,end-start);
x

else
{USER_DEFINED_DATA.CAD751}

Thanks



IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 16 Oct 2013 at 4:48am
First off, what error are you getting?   In looking at your if statement, be aware that Crystal does not work quite like BASIC and I have noticed odd results if you do not put parans around code of the then of the if statement (also on the else, if a multi-statement).

if {USER_DEFINED_DATA.ASSESSMENT_MONIKER} = "4D17FC8EFA484E8B884E5F1C9B3D55DB"

then
(
stringvar x;
numbervar start;
numbervar end;

 x:={USER_DEFINED_DATA.ASSESSMENT_DATA};
start:= instr(x,'@@T_400_ = ') + 12;
end := instr(x,'"@@T_501');
x:=mid(x,start,end-start);
x
)
else
{USER_DEFINED_DATA.CAD751}
IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 16 Oct 2013 at 4:54am
sorry..sorry....

I didn't enclose it in "("

Thanks...


Edited by jbalbo - 16 Oct 2013 at 4:55am
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.031 seconds.