Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Syntax Question Post Reply Post New Topic
Author Message
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Topic: Formula Syntax Question
     Posted: 13 Jan 2010 at 9:49am
I'm trying to auto-populate NULL fields with this statement:
 
if isnull({tblWilliamsGrantExpenditures.DocumentNum}) then 'Various, see attachments' else totext({tblWilliamsGrantExpenditures.DocumentNum})
 
Not sure what's wrong. Populated fields show up, and NULL values remain NULL.
IP IP Logged
rkorb
Newbie
Newbie
Avatar

Joined: 04 Sep 2009
Location: United States
Online Status: Offline
Posts: 31
Quote rkorb Replybullet Posted: 13 Jan 2010 at 11:02am
did you try putt ing () around (totext({tblWilliamsGrantExpenditures.DocumentNum}))
?  Sometimes () really help:)
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 13 Jan 2010 at 11:11am
I changed the statement to:
 
if isnull({tblWilliamsGrantExpenditures.DocumentNum})
then 'Various, see attachments'
else (totext({tblWilliamsGrantExpenditures.DocumentNum}))
 
and had the same results as before. Nothing in the NULL value fields.
IP IP Logged
rkorb
Newbie
Newbie
Avatar

Joined: 04 Sep 2009
Location: United States
Online Status: Offline
Posts: 31
Quote rkorb Replybullet Posted: 13 Jan 2010 at 11:17am
Try double  quotes
if isnull({history_diagnosis.axis_IV_prim_sup_grp_code})
then "Various, see attachments"
else (totext({history_diagnosis.axis_IV_prim_sup_grp_code}))
 
I have my field name becasue I was trying it out on my data.
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 13 Jan 2010 at 12:13pm
Didn't make any difference w/ double quotes.
 
if isnull({tblWilliamsGrantExpenditures.DocumentNum})
then "Various, see attachments"
else (totext({tblWilliamsGrantExpenditures.DocumentNum}))
 
I know it has to be something simple like this!?!?!
IP IP Logged
rkorb
Newbie
Newbie
Avatar

Joined: 04 Sep 2009
Location: United States
Online Status: Offline
Posts: 31
Quote rkorb Replybullet Posted: 13 Jan 2010 at 12:16pm
It totally worked in my system so I'm not sure.  I copied my formula right out of the edit window!
Curse you Crystal Reports!!!!
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 13 Jan 2010 at 12:20pm
Thanks for your efforts. I may try something else. I originally thought I could do something similar to this post I used successfully not long ago:
 
if isnull({tblWilliamsGrantExpenditures.Date}) or {tblWilliamsGrantExpenditures.Date}<Date(1900,01,01) then 'Various, see attachments' else totext({tblWilliamsGrantExpenditures.Date},'MM/dd/yyyy')
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