Crystal Reports syntax

Hello,

I have a ; or ( in the wrong place.  Can you please help me straiighten this code out?  
Thanks, Joel

if {tblRevisions.DrawingStage} = "Ready For Fab Docs" or {tblRevisions.DrawingStage} = "Released For Fab" then
 if {tblTaskLock.PaymentTerms} = "Net30" then
	Start := RealDueDate2+1;
	End := CDate({tblRevisions.CurrentRevisionOut});
	StartWeekend := RealDueDate2;
 else
	Start := RealDueDate3+1;
	End := CDate({tblRevisions.CurrentRevisionOut});
	StartWeekend := RealDueDate3;
else
	Start := RealDueDate+1;
	End := CDate({tblRevisions.CurrentRevisionOut});
	StartWeekend := RealDueDate ;

Open in new window

Genius123Asked:
Who is Participating?
 
James0628Commented:
Peter's version should work, but I don't think you really need the () around the inner if-else.

if {tblRevisions.DrawingStage} = "Ready For Fab Docs" or {tblRevisions.DrawingStage} = "Released For Fab" then
 if {tblTaskLock.PaymentTerms} = "Net30" then
 (
      Start := RealDueDate2+1;
      End := CDate({tblRevisions.CurrentRevisionOut});
      StartWeekend := RealDueDate2;
 )
 else
 (
      Start := RealDueDate3+1;
      End := CDate({tblRevisions.CurrentRevisionOut});
      StartWeekend := RealDueDate3;
 )
else
(
      Start := RealDueDate+1;
      End := CDate({tblRevisions.CurrentRevisionOut});
      StartWeekend := RealDueDate ;
);


 James
0
 
peter57rCommented:
Try...

if {tblRevisions.DrawingStage} = "Ready For Fab Docs" or {tblRevisions.DrawingStage} = "Released For Fab" then
( if {tblTaskLock.PaymentTerms} = "Net30" then
      (Start := RealDueDate2+1;
      End := CDate({tblRevisions.CurrentRevisionOut});
      StartWeekend := RealDueDate2)
 else
      (Start := RealDueDate3+1;
      End := CDate({tblRevisions.CurrentRevisionOut});
      StartWeekend := RealDueDate3))
else
      (Start := RealDueDate+1;
      End := CDate({tblRevisions.CurrentRevisionOut});
      StartWeekend := RealDueDate) ;
0
 
Genius123Author Commented:
Thanks, worked great.
0
 
James0628Commented:
I agree with mlmcc.  At most, my post was just a very slight variation/simplification.  I don't need any points for it.

 You can ask to have the question re-opened and then award most/all of the points to Peter.

 James
0
 
Genius123Author Commented:
mlmcc, can you please reopen this so I can split the points accordingly?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.