Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: formula field? Post Reply Post New Topic
Author Message
STata
Newbie
Newbie


Joined: 25 Sep 2007
Location: United States
Online Status: Offline
Posts: 8
Quote STata Replybullet Topic: formula field?
     Posted: 07 Aug 2008 at 11:08am
I have a report and a sub-report that work great. However, I now want to add a field that will have values 'Yes' or 'No' based on a condition. I can't seem to make it work. I have a formula field that says:
 
if {A.USROBJID}={B.USROBJID} and {A.USRGRPOBJID}= 1465 then 'Y' else 'N'
 
This is producing 'N' all the time even when the condition is valid. What am I doing incorrectly here or is there a better way to accomplish this. Thanks.
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 08 Aug 2008 at 12:04pm
I knowyou said that everything is true. However, it might be worth debugging if you have not.
 
I would suggest for debugging trying the two parts of the if statement separately.
 
Try the a = b comparison to make sure it returns true
Then separately
try the a.usrgrp... = 1465  to make sure it returns true
 
I suppose it could be a datatype issue, for example  strings vs. numbers which could easily be missed. However, debugging by trying the 2 comparisons separately should help you find the problem(s) by clearly showing which is failing to be true.
 
Regards,
 
John W.
IP IP Logged
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