Depending on your sql you might be able to deduct index from the date (might require trunc / modifying your query a bit)
Names Default To Here(1);
start_date = 01Jul2023;
end_date = 31Jan2024;
datecount = Date Difference(start_date, end_date, "Day");
Show(As Date(start_date + In Days(datecount)));
sql_template = "\[select sysdate - ^i^ startdate, sysdate - ^i - 1^ enddate from dual]\";
For(i = 1, i <= datecount, i++,
cur_sql = Eval Insert(sql_template);
Show(cur_sql);
);
Also you most likely want to concatenate the query results inside the query and adding some simple print logging can be helpful (I usually print at least: current index/date which is being queried, how many rows you got back and how long the query took).
-Jarmo