Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: If date is empty then enter text Post Reply Post New Topic
Author Message
shabbaranks
Groupie
Groupie


Joined: 06 Oct 2013
Location: United Kingdom
Online Status: Offline
Posts: 66
Quote shabbaranks Replybullet Topic: If date is empty then enter text
    Posted: 22 Oct 2015 at 11:11pm
Hi,

Im trying to get my formula to enter text if a date field is empty. It works fine if I have 2 separate formulas but ideally I would like to combine it to one - any ideas where Im going wrong please?

if isnull({Source.Last_Recv_Date}) then "Not Recieved" else cdate({Source.Last_Recv_Date})

Thanks as always
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Oct 2015 at 2:59am
is your field text or or a datetime field?
your result from the formula has to be of a single datatype so you cannot mix it to be text in one case and a date in the other (cdate). Assuming the original field is a date or datetime type just format the result as a string to look like a date

if isnull({Source.Last_Recv_Date}) then 'Not Received' else totext({Source.Last_Recv_Date},'MM/dd/yyyy')
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.032 seconds.