Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: DateDiff - getting error formula must be a number Post Reply Post New Topic
Author Message
jrs1234
Newbie
Newbie


Joined: 02 Mar 2009
Location: United States
Online Status: Offline
Posts: 37
Quote jrs1234 Replybullet Topic: DateDiff - getting error formula must be a number
     Posted: 20 Oct 2009 at 8:04am
Hello,
 
I have created a formula called '5DayVisit' and the formula reads:
 
that displays the number of days between my two dates.
 
now I am trying to use the detail line to supress if that {@5DaysVisit} > 5 - when I put in that formula to surpress I get :
 
The formula result must be a number ..
 
any ideas? I did try putting the tonumber function in front of the datadiff and I still get that error ...
 
Thanks!
JennAngry
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2009 at 8:27am
Hard to tell since you are using a lot of formulas on top of each other.
What do you get if you place your suppression on details section with:


Edited by DBlank - 20 Oct 2009 at 8:27am
IP IP Logged
jrs1234
Newbie
Newbie


Joined: 02 Mar 2009
Location: United States
Online Status: Offline
Posts: 37
Quote jrs1234 Replybullet Posted: 20 Oct 2009 at 8:54am
Yes, that formula works to supress the detail line - however I just figured out what I need to do is change the color of the background of the detail line to yellow...
 
So I tried using this formula in the Color section of the detail line and I get the same error as above - it is 'not' numeric.
 
Thanks,
Jenn
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2009 at 8:58am
if datediff('d',5">{@AdmissionDate},{@ContactDate})>5 then crYellow else crNocolor

Edited by DBlank - 20 Oct 2009 at 9:02am
IP IP Logged
jrs1234
Newbie
Newbie


Joined: 02 Mar 2009
Location: United States
Online Status: Offline
Posts: 37
Quote jrs1234 Replybullet Posted: 20 Oct 2009 at 9:01am
Thanks .. I was able to change the formula a bit and it worked!!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2009 at 9:05am
Sorry about that. It keeps throwing extra stuff in the middle of the formula even though I edited it 3 times...Weird.
For reference it should be:
if datediff('d',{@ AdmissionDate},{@ ContactDate}) >5 then crYellow else CrNocolor


Edited by DBlank - 20 Oct 2009 at 9:05am
IP IP Logged
jrs1234
Newbie
Newbie


Joined: 02 Mar 2009
Location: United States
Online Status: Offline
Posts: 37
Quote jrs1234 Replybullet Posted: 20 Oct 2009 at 9:07am
lol - no problem, I figured it out :)
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