I would get the data you need in a variable from the ds table and then use it as a criteria in the DB table: