I am receiving this error when running this code, what am I missing here.
I am using the Text function to try to change the data type as I was getting qvd's created for 201413, 201414 etc, I only want a file for every actual Period which runs from 2003 - 01 through 12, then 2014-01 to 12
Script line error:
FOR vPeriod = to
LOAD distinct Text(HPeriod) as Period
order by HPeriod;
LOAD FirstValue(HPeriod) as MinPeriod,
LastValue(HPeriod) as MaxPeriod
LET vPeriodMin = Peek(MinPeriod);
LET vPeriodMax = Peek(MaxPeriod);
FOR vPeriod = $(vPeriodMin) to $(vPeriodMax)
LOAD * Resident HISTORYAGEING where HPeriod = $(vPeriod);
Please try to understand the script below and implement it.
I have tried to include notes where I feel clarification is needed.
LET vMin = FLoor(MakeDate(2015,04,20));
LETvMax = FLoor(MakeDate(2015,04,30));
LETvDiff = vMax - vMin + 1; // Plus 1 here ensure we have to full range of date differerence DateIsland: LOAD $(vMin) + RecNo() -1 ASDate//Minus 1 here ensures that the date starts from the vMin date in our loop AutoGenerate ($(vDiff)); //Load full date range FORi = 0 TONoOfRows('DateIsland') LETvQVDDate = Date(Peek('Date',$(i),'DateIsland'),'YYYY-MM-DD'); TRACE$(vQVDDate); //Here include your store procedure scripts NEXTi;