A.NY= LETF(B.NY,6,0) ?
A.NY = LEFT(replace(B.NY,"-",""),6)
————————————————————
oracle
A.NY = substr(replace(B.NY,"-",""),1,6)