Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table left outer join to another returns nulls - can I calc on that

Status
Not open for further replies.
Mar 10, 2003
25
GB
Hi

Table A is linked to Table B via a left outrer join. Table B therefore only returns records in cases where a record in both tables extist. I need to do a formula that cuts across the whole dataset (I.e. where records are returned - where there was a match; and where no records where returned - where there was no match and thus a null field). The example shows col1 (from table A), col2 (the matching column where applicable from table B), col3 (from table B - contents is always AFFS), the result of the formula herewith, and the Ideal result.
Code:
If col3 = 'AFFS' then 'AFFS' else
If isnull (col3) then 'Other' else
If col3 <> 'AFFS' then 'Other' else
'Other'

col1 col2 col3 @formula @ideal
1 Other
2 2 AFFS AFFS AFFS
3 Other
4 Other
5 5 AFFS AFFS AFFS
6 6 AFFS AFFS AFFS
7 Other

Is this at all possible. I have tried many permutations in tghe formula such as startswith ' ', like '*', etc
 
Hi,
In Crystal, always test for NULLs first in any formula, so try:

Code:
If ( isnull({col3}) or trim({col3}) = "" )
then 'Other' 
else
{col3}





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top