lcPattx = '' for ix = 1 to 186 lcPattX = lcPattx + ; ',sum(T'+padl(ix-1,3,'0')+') as T'+padl(ix-1,3,'0') endfor select f1,f2,f3 &lcPattX from ...Then this :
lcPattx = '' for ix = 1 to 186 lcPattX = lcPattx + ; 'sum(T'+padl(ix-1,3,'0')+') as T'+padl(ix-1,3,'0')+', ;'+chr(13) endfor _cliptext = lcPattXand pasted the code. I even tried removing 'as ...' part. Total commandline length is 4199 at max. Both approaches crash VFP. Any ideas other than not using SQL ? TIA