select 
    A.code,A.date as date1,b.date as date2,b.su 
from 
    A,B 
where 
    datediff(mm,A.date,B.date)=0