Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Please advise Post Reply Post New Topic
Author Message
venky_115
Groupie
Groupie
Avatar

Joined: 15 Jun 2010
Location: United States
Online Status: Offline
Posts: 67
Quote venky_115 Replybullet Topic: Please advise
     Posted: 17 May 2011 at 1:17am
Hello Frndz,
 
I am using crystal report XI, i have to create a formula to divide two amount fields,if we get divide by zero error we should display "N/A",else we shud display answer.
 
Eg: Amtfield1,Amtfield2
 
if Amtfield1=1234 and Amtfield2=0 then 1234/0 should dispaly "N/A"
else Amtfield1=1234 and Amtfield2=1234 we shud display 0.. like wise
 
Please advise
 
Regards
Venky
Regards
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 May 2011 at 3:35am
if Amtfield2=0 then "N/A" else
totext(Amtfield1/Amtfield2,0)
IP IP Logged
venky_115
Groupie
Groupie
Avatar

Joined: 15 Jun 2010
Location: United States
Online Status: Offline
Posts: 67
Quote venky_115 Replybullet Posted: 17 May 2011 at 4:00am
Thanks but "N/A" is string right, how can we assign to a value filed?
Regards
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 May 2011 at 4:05am
that is why the else has a totext()
IP IP Logged
venky_115
Groupie
Groupie
Avatar

Joined: 15 Jun 2010
Location: United States
Online Status: Offline
Posts: 67
Quote venky_115 Replybullet Posted: 17 May 2011 at 9:46pm
Thanks, its working
Regards
IP IP Logged
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