I need to be able to get summations for various tables where the structures are not known at coding time. Does anyone have something better than this?
local nStop,i,cBuff
use ?
nStop=afields(aList)
cBuff="select cAcctNo "for i = 1to nStop
if aList[i,2]="N"
cBuff = cBuff+",sum("+aList[i,1]+")"endifnext
cBuff=cBuff+" from "+dbf()