Nov 17, 2009 #1 abc567 Programmer Joined Jul 8, 2009 Messages 45 Location US Hi, I am required to write a condition like, NumberVar df= Datediff('d',Field1, Field2); if ( 0 < df <=50 ) then 1 else 0 But i am unable to write it in formula..
Hi, I am required to write a condition like, NumberVar df= Datediff('d',Field1, Field2); if ( 0 < df <=50 ) then 1 else 0 But i am unable to write it in formula..
Nov 17, 2009 #2 Madawc Programmer Joined Sep 5, 2002 Messages 7,628 Location GB Try a formula field with Code: Datediff('d',Field1, Field2) Then another with Code: If @Diff <=50 then 1 else 0 For most purposes, formula fields are easier than variables. Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP Upvote 0 Downvote
Try a formula field with Code: Datediff('d',Field1, Field2) Then another with Code: If @Diff <=50 then 1 else 0 For most purposes, formula fields are easier than variables. Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP
Nov 17, 2009 #3 lbass Technical User Joined Feb 9, 2002 Messages 32,818 Location US I would change that last formula to: If {@Diff} >= 0 and {@Diff} <= 50 then 1 else 0 Make sure you have syntax set to Crystal syntax (above the formula area). -LB Upvote 0 Downvote
I would change that last formula to: If {@Diff} >= 0 and {@Diff} <= 50 then 1 else 0 Make sure you have syntax set to Crystal syntax (above the formula area). -LB