Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Simple If Then Statement for Null Value Post Reply Post New Topic
Author Message
ClantonC
Newbie
Newbie
Avatar

Joined: 08 Feb 2014
Online Status: Offline
Posts: 19
Quote ClantonC Replybullet Topic: Simple If Then Statement for Null Value
     Posted: 20 Feb 2014 at 4:45am
Please forgive me for posting something so simple but I am having trouble with a very short formula. It says that the "then" is missing...
 
If {Codes_.UCR Discription} isnull then
"0" else {YTD_.CountsYTD}
 
Thank you for all your help!
 
IP IP Logged
lolly54
Groupie
Groupie
Avatar

Joined: 25 Sep 2011
Online Status: Offline
Posts: 58
Quote lolly54 Replybullet Posted: 20 Feb 2014 at 4:58am
it should be...

If isnull({Codes_.UCR Discription}) then
"0"
else
{YTD_.CountsYTD}

isnull is a function. :)


Edited by lolly54 - 20 Feb 2014 at 4:59am
IP IP Logged
ClantonC
Newbie
Newbie
Avatar

Joined: 08 Feb 2014
Online Status: Offline
Posts: 19
Quote ClantonC Replybullet Posted: 20 Feb 2014 at 5:08am
Thank you for your help!
 
It is the saying it is looking for a string but i need it to display the number value in the {YTD_.CountsYTD} field.
 
IP IP Logged
lolly54
Groupie
Groupie
Avatar

Joined: 25 Sep 2011
Online Status: Offline
Posts: 58
Quote lolly54 Replybullet Posted: 20 Feb 2014 at 5:15am
You double quoted the "0"

change it to 0

If isnull({Codes_.UCR Discription}) then
0
else
{YTD_.CountsYTD}

it will work! :)



Edited by lolly54 - 20 Feb 2014 at 5:15am
IP IP Logged
ClantonC
Newbie
Newbie
Avatar

Joined: 08 Feb 2014
Online Status: Offline
Posts: 19
Quote ClantonC Replybullet Posted: 20 Feb 2014 at 5:37am
It isn't giving anymore errors but it isn't entering 0's in the fields where there isn't a value for {Codes_.UCR Discription}
 
my common link between tables is {Codes_.UCR Discription} each table may have duplicate values "{YTD_.CountsYTD}" and that is ok because i am grouping and summing those numbers. but not every table has an entry for {Codes_.UCR Discription} so on those tables I need to asign it a 0 value more or less for a place holder so i can line 4 sub reports up to apear as colums useing on label "{Codes_.UCR Discription}" for each row.
 
 
Thank you so very much for your help!!!!!!!


Edited by ClantonC - 20 Feb 2014 at 5:38am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Feb 2014 at 6:45am
if you are linking on a field that has no values in some rows you have to make sure you are doing an outer join to inlcude the rows with no matching 'description'
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