Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Why is ELSE not working? Post Reply Post New Topic
Author Message
cant2ny
Newbie
Newbie


Joined: 11 Oct 2011
Online Status: Offline
Posts: 9
Quote cant2ny Replybullet Topic: Why is ELSE not working?
    Posted: 28 Feb 2012 at 10:06am
Can anyone tell me why the Else is not being triggered in the following snippet?

local StringVar DateConversion :=
mid({Command.receivedDate},5,2)+"/"+right({Command.receivedDate},2)+"/"+Left({Command.receivedDate},4);
local StringVar RecievedDate;

if {Command.receivedComment} = "Need to contact pt"
then (RecievedDate := DateConversion + "-"+ "Need to contact pt")
Else If {Command.receivedComment} = "No need to contact pt"
then (RecievedDate := DateConversion + "-"+ "No need to contact pt")
else RecievedDate := DateConversion;

The IfElse works correctly, but the ELSE is failing and not pulling just the date. I've confirmed in the DB that there is a date for the record in question.

Edited by cant2ny - 28 Feb 2012 at 10:06am
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 28 Feb 2012 at 10:53pm
Is there any null values in command.receivedcomment?
 
Also, depending on what other values are contained in the command.receivedcomment field I don't even think you need an IF statement here.
 
You could put simply;
 
DateConversion + "-" + {command.receivedcomment}
 
Regards,
Ryan.


Edited by rkrowland - 28 Feb 2012 at 10:56pm
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.031 seconds.