I'm trying to join a table on a number that is in a number format, number (9,0) with a table with the number in varchar format, varchar (10,0). The biggest problem I'm encountering is that the varchar number has a hyphen before the last two digits (i.e., 999999-99). I'm not getting an error, but the script I'm using returns no results. Any ideas how to fix this? Thanks!
from rp.r_bills rb
join st.a_assistant aa
on to_char(rb.ga30_nbr, '99999999') = replace(aa.ga_30, '-', '')
and rb.liab_amt = aa.net_result