Question : Query to include another table

I have a query that was working with two tables, but when I tried to includ the third, it won't run.
This was the query that ran:

Select distinct expr.fac_id, fxf.fac_id, expr.cust_nbr, fxf.cust_nbr
from business_alignment expr  left outer join business_alignment fxf
on expr.fac_id = fxf.fac_id
and date between fxf.eff_dt and fxf.exp_dt
and fxf.company_cd = 'FDFR'
where
date between expr.eff_dt and expr.exp_dt
and expr.company_cd = 'FX'
and fxf.cust_nbr in (10508540)

I uploaded a table with a list of accounts instead of and fxf.cust_nbr in (10508540).
So I want to run all the new account numbers and have them return the same information.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
Select distinct expr.fac_id, fxf.fac_id, expr.cust_nbr, fxf.cust_nbr
from business_alignment expr  left outer join business_alignment fxf, UI_RESULTS_DB.adamfxf
on expr.fac_id = fxf.fac_id
and date between fxf.eff_dt and fxf.exp_dt
and fxf.company_cd = 'FDFR'
where 
date between expr.eff_dt and expr.exp_dt
and expr.company_cd = 'FX'
and fxf.cust_nbr = UI_RESULTS_DB.adamfxf.acc
Open in New Window Select All

Answer : Query to include another table

Small mistake in your syntax..
Check this out.
1:
2:
3:
4:
5:
6:
7:
8:
Select distinct expr.fac_id, fxf.fac_id, expr.cust_nbr, fxf.cust_nbr
from business_alignment expr  
left outer join business_alignment fxf on expr.fac_id = fxf.fac_id
and date between fxf.eff_dt and fxf.exp_dt
and fxf.company_cd = 'FDFR'
inner join UI_RESULTS_DB.adamfxf af on fxf.cust_nbr = af.acc
where date between expr.eff_dt and expr.exp_dt
and expr.company_cd = 'FX'
Open in New Window Select All
Random Solutions  
 
programming4us programming4us