Hi All,
I am trying pull some data from the database by looping through dates, in this example, I am trying to loop from June until the date yesterday. This is my sample code. However, it is not working. Can someone explain how to properly do it? TIA
d = Today() - In Days(1);
dateNow = Format (d, "m/d/y");
startdate = "2023-06-01";
For( i = startdate, i <= dateNow, i++,
try(
dt = Open Database( "DSN=db ;UID=user123;PWD=qwerty;APP=JMP;DATABASE=zxcv;",
"Select * from table1
where date_time between '" || [i] || " 00:00:00 AM' and '" || [i] || " 11:59:59 PM'",
"dt1" );
));