Writing Code
 Crystal Reports Forum : Crystal Reports .NET 2003 : Writing Code
Message Icon Topic: if, then else statement Post Reply Post New Topic
Author Message
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Topic: if, then else statement
    Posted: 15 May 2014 at 10:31am
I keep getting an error an am not sure why my formula reads:
if {Est.Hrs}=0 then (({Lead.Days})"D") else {Est.Hrs}
It works fine if I get rid of the "D" and keep it really simple, but I was to identify when it days and when it is hrs.  Thanks for your help!
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 15 May 2014 at 10:45am
You do not have a function associated with {Lead.Days}.  Did you want to use the datepart function?
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 16 May 2014 at 2:05am
{Est.Hrs} returns the number of hours assigned, I would like the {Lead.Days} to return the number of days assigned and would like to have a "d" appear at the end of that number so people are aware that it is days not hours.  Right now if I take out the "D" in the formula, I get the correct results but it  say "3" and I would like it to say "3 D". I want people to know it's 3 Day not hours.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 16 May 2014 at 6:17am
Then you would probably do something like this:
if {Est.Hrs}=0 then totext({Lead.Days},0)+" D" else {Est.Hrs}
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.