1DELETE FROM tableA
2WHERE ROWID IN
3 ( SELECT q.ROWID
4 FROM tableA q
5 INNER JOIN tableB u on (u.qlabel = q.entityrole AND u.fieldnum = q.fieldnum)
6 WHERE (LENGTH(q.memotext) NOT IN (8,9,10) OR q.memotext NOT LIKE '%/%/%')
7 AND (u.FldFormat = 'Date'));
8