I have a left outer join from my main table to a ref table on the field dx_code. I need a formula that says if the code exists in the ref table show it, but if it doesn't then use the main.dx_code. This is what I have, but it gives blanks if the code doesn't exist in the ref table...
IF main.dx_code = ref.dx_code
then ref.dx_code
else if main.dx_code <> ref.dx_code or isnull(ref.dx_code)
then main.dx_code
else main.dx_code
IF main.dx_code = ref.dx_code
then ref.dx_code
else if main.dx_code <> ref.dx_code or isnull(ref.dx_code)
then main.dx_code
else main.dx_code