Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula for formatting Post Reply Post New Topic
Author Message
Deepodaya
Newbie
Newbie


Joined: 02 Sep 2008
Location: United States
Online Status: Offline
Posts: 2
Quote Deepodaya Replybullet Topic: Formula for formatting
     Posted: 02 Sep 2008 at 7:37am
Hi
   I am trying to print a number and corresponding formatted number based on a condition of "Y" or "N".I want to see just the number and not any corresponding formatted number when the condition is "N".
 
The formatted number is showing up fine when the condition is "y" but when it is "n" I expect to see just the number and nothing for the formatted number but I don't even see the number. Here is the formula I am using
 
If {Table1.Field1}= "N" then " "
Else if {Table1.Field1} = "Y" then
totext(Left({Table2.Field1},2)) + '-' + totext(Mid({Table2.Field1},3,3)) + '-'
+ totext(Mid({Table2.Field1},6,2)) + '-' + totext(Mid({Table2.Field1},8,4)) + '-'  + totext(Right({Table2.Field1},4))
 
Thanks
Deepa
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 02 Sep 2008 at 3:44pm

For the "N" part, you are returning an blank string. You need to tell it to return the number instead.

If {Table1.Field1}= "N" then {Table2.Field1}
 
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Deepodaya
Newbie
Newbie


Joined: 02 Sep 2008
Location: United States
Online Status: Offline
Posts: 2
Quote Deepodaya Replybullet Posted: 03 Sep 2008 at 6:10am
Thanks!! It is working now..The problem was a inner join in the SQL query.It got fixed when I changed it to left join.
 
Deepa
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 03 Sep 2008 at 10:35am
Great!
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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