@ypercubeᵀᴹ - I noticed that you took an interest in this answer - so did I - I have a couple of questions pursuant to my answer - 1) I'm a bit confused as to why here (TO_DATE(cyr::TEXT || cwk::TEXT, 'YYYYWW') + INTERVAL '3 DAY')::DATE it is necessary to add 3 days to get the correct start of the week? I got that code from
here.