Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All, I'm trying to create a table o records being single days out of given periods. To do so, I'm using for...next loop but get stuck with defining "TO" value in the counter. The script looks like below:
SQL SELECT StartDate, EndDate FROM db1.
LET B = EndDate - StartDate
FOR i=0 TO '$(B)'
StartDate + '(i)' AS Day
FROM db1
When I put marks to B i.e. B = 'EndDate - StartDate' the script starts off but goes beyond the high limit. Could you please help with the code?
BR, Przemek
Hi, try this script change
SQL SELECT StartDate, EndDate FROM db1.
LET B = num(EndDate - StartDate); //just in case 😉
FOR i=0 TO $(B)
Load //why you don't have a load statement if you have a From??
StartDate + $(i) AS Day
FROM db1 //where is the select/load of this from??
you can use the trace $(B), and with the option "Generate Log File" in "Document Properties", you will see the B value
rgds