I guess that could help with troubleshooting.
h.refID varchar(50)
s.DistributorOrd varchar(50)
WHERE s.DistributorOrderNumber is null should be ...DistributorOrd... still not working
the information is initially imported from the h. table into the s....