Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: > Date in IF Stmt Post Reply Post New Topic
Author Message
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Topic: > Date in IF Stmt
    Posted: 28 Jan 2015 at 1:00pm
I am trying to pull in the following formula;
 
If isnull ({AM.SURG_DATE}) then "Blank"
else
if {AM.DISCH_DATE} > Date(2014,10,01)
then totext({AM.SURG_DATE})
 
Trying to say that is the SURG DATE is null, give me "Blank" and if the DISCH_DATE is greater than 10,01,2014 then give me the SURG_DATE.
 
So far all of this works, except for the > 10,01,2014 portion and I can't figure out why.
 
Just a newbie, but appreciate any help!Smile
IP IP Logged
Vimal Nair
Newbie
Newbie
Avatar

Joined: 29 Dec 2014
Location: United Arab Emirates
Online Status: Offline
Posts: 26
Quote Vimal Nair Replybullet Posted: 28 Jan 2015 at 6:37pm
Try This

If Isnull({AM.DISCH_DATE}) Then ""
Else
If Date(ToText({AM.DISCH_DATE},dd/MM/yyyy))>Date(2014,10,01) Then totext({AM.SURG_DATE})

Born To Live
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 29 Jan 2015 at 5:31am
Thank you so much Vimal!!  It got me thinking this morning it worked they way you suggested, then I realized I need it 'and' to cover both errors, since we highlight one as an error and need it to say "Blank" for the staff to see and correct....So I ended up with this!
 
If Isnull({AM.SURG_DATE})and Date(ToText({AM_.DISCH_DATE}))>Date(2014,10,01) Then "Blank"
Else totext({AM.SURG_DATE})
 
Works perfectly!
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.047 seconds.