Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: If Then Else DateDiff Forumla ? Post Reply Post New Topic
Author Message
ashline
Newbie
Newbie


Joined: 22 May 2010
Online Status: Offline
Posts: 15
Quote ashline Replybullet Topic: If Then Else DateDiff Forumla ?
     Posted: 07 Nov 2010 at 3:26am
OK I would think this would be straight forward but I am getting an error with this formula
 
IF IsNull ({_TELMASTE_.CLOSED ON}) Then
    "Open"
Else
   DateDiff ("d",{_TELMASTE_.DATE OPEN} ,{_TELMASTE_.CLOSED ON})
 
The Datediff works by its self and so does the Isnull statement but when combined together with a If Then Else its says a string is required here then highlights the DateDiff line.
 
Any Suggestions?
Thanks
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 08 Nov 2010 at 1:43am
your formula is correct.

but you need to convert your 'else' statement as String.

because if your condition is 'true' it will print a text/string ("open").
so if the condition is 'false' then you need to print the result as text/string rather than 'date' format (convert your datediff as string).


hope it help.


Emir W
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