Insert to a table using loops

Hey All,
I have a use case that I need to iterate on an sql query and insert the results each iteration to an existing table.
for example I want to run it on a period of 3 days, so each iteration will have a different date
so for example, {{loop_date}} will be 1.1.2023 on the first iteration,
then on the second iteration it will be 2.1.2023 (January 2nd)
and last, 3.1.2023 (January 3rd).
with this WHERE clause:

date_field BETWEEN '{{loop_date}}'  - INTERVAL '1 months' AND '{{loop_date}}' - 1

can someone share a similar code? and also how to send the timeframe for the loop? I tried with “date_spine” util and also something is not working fully.
I know there is “insert_by_period” but it is not supported for me.

thanks for your help

Hi, How are you able to insert in existing tables? I am having problem in that bit.