Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Help- Syntax issues Post Reply Post New Topic
Author Message
crystalforlife
Newbie
Newbie


Joined: 06 Jun 2008
Online Status: Offline
Posts: 1
Quote crystalforlife Replybullet Topic: Help- Syntax issues
    Posted: 06 Jun 2008 at 10:33am
Hi, I'm pretty useless with Crystal Reports and there is no one in my office who has a clue...

I am trying to count the number of days between when projects start and end.  The problem is when there is no end date (the project isn't finished).  How do I write a formula that will count the days when there is an end date and substitute todays date when there is no value in the end date column?

I have tried this:

if (end_date)-(start_date)>0
then (end_date)-(start_date)
else (current_date)-(start date)

but it doesn't work.  How can I tell Crystal to recognize the null values in the end date column and insert todays date?

Thanks for your help!
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 14 Aug 2008 at 1:28pm
Did you ever figure this out ? 
Try creating a formula like this.  Move the field to your report.
if isnull({end_date}) then
      DateDiff("d",{begin_date},CurrentDate)
else
      datediff("d",{begin_date},{end_date})
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.