Query to extracting the 14th date from a date after excluding the sunday and saturday in Postgresql
WITH cand AS (
   SELECT DATE '2020-01-30' - i AS d
   FROM generate_series(1, 2*14+3) AS i
)
SELECT d
FROM cand
WHERE extract(isodow FROM d::timestamp) &lt; 6
ORDER BY d DESC
OFFSET 13
LIMIT 1;


The 2*14+3 in the CTE is a safe upper limit and can be improved.