update da8, da5
set da8.p03=concat(substr(da8.p03, 7, 4), '-', substr(da8.p03, 4, 2), '-', substr(da8.p03, 1, 2)), 
    da8.remdate=curdate(), 
    da8.remtime=curtime()
where da8.p02=da5.nr01
   && da5.p04='D'
   && locate('/', da8.p03)=3
       


update db5, db2
set db5.p03=concat(substr(db5.p03, 7, 4), '-', substr(db5.p03, 4, 2), '-', substr(db5.p03, 1, 2)), 
    db5.remdate=curdate(), 
    db5.remtime=curtime()
where db5.p02=db2.nr01
   && db2.p04='D'
   && locate('/', db5.p03)=3
       
