Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a loop
For A=2 to 3
Right Keep
Sampling2:
Load
eEngNumber,
ePartner,
[Engagement Start Date]
Resident Sampling1
where ePartner <> $(vPartnerB);
drop table Sampling1;
let vNumberOfRows2=NoOfRows('Sampling2');
let vRand=ceil(rand()*$(vNumberOfRows2),1);
let vEngNumber=peek('eEngNumber',$(vRand),'Sampling2');
let vPartner=peek('ePartner',$(vRand),'Sampling2');
let vEngNumber=peek('eEngNumber',$(vRand),'Sampling2');
Let vPartnerB=chr(39) & peek('ePartner',$(vRand),'Sampling2') & chr(39);
Let vEngIDs=$(vEngIDs) & ',' & $(vEngNumber);
Let vPool=$(vPool) & ',' & $(vNumberOfRows2);
Rename table Sampling2 to Sampling1;
NEXT
The 2 bold lines work the first time through the loop but error the next time through.
The first value is is set outside of this loop 2000495901
the first time through the loop it appends to vEngIDs the value 3000071383 and there is no problem yet.
the third and any subsequent times through the loop it errors as shown above.
No other lines have issues
Any thoughts?
What if you do this:
Let vEngIDs= '$(vEngIDs)' & ',' & $(vEngNumber);
Let vPool= '$(vPool)' & ',' & $(vNumberOfRows2);
Solved it. put single qoute around $(vEngIds) and for second one do ',$(vEngNumber)'
What if you do this:
Let vEngIDs= '$(vEngIDs)' & ',' & $(vEngNumber);
Let vPool= '$(vPool)' & ',' & $(vNumberOfRows2);