Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: formula syntax comparing fields Post Reply Post New Topic
Author Message
cold_witt
Newbie
Newbie
Avatar

Joined: 16 Mar 2010
Location: United States
Online Status: Offline
Posts: 3
Quote cold_witt Replybullet Topic: formula syntax comparing fields
    Posted: 16 Mar 2010 at 4:01am
After 8 years, I'm coming back to Crystal and learning all over again. 
I have a report where one field will depend on the results of another. 
The first field "ID_Type" is a formula that returns either the PO number or the Contract number.  Based on what that result is, the  formula "Exp Date" will return one of two database fields- either the PO_End_Date or the Contract_Exp_Date.
 
For ID_Type, I have the following syntax -
If instr({Contract_Prepay_Balance.SortType},"PO")>0 then
  formula="PO #"
else
  formula="Contract #"
end if
 
I think I can use this same syntax for the second "Exp Date", but not sure
If instr({Contract_Prepay_Balance.SortType},"PO")>0 then
  Exp_Date={Contract_Prepay_Balance.PO_End_Date}
else
  Exp_Date={Contract_Prepay_Balance.Contract_Exp_Date}
end if
 
Thanks!
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 16 Mar 2010 at 6:31am
Looks good to me.  Unless there is some syntax I missed.
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.016 seconds.