select stock local oxtab oxtab = newobject("FastXtab", "fastxtab.prg") oxtab.coutfile = 'results' && output (cursor/dbf) name, change it at your will *oXtab.lCursorOnly = .T. && .T. creates a cursor while .F. a dbf oxtab.crowfield = 'usno' && rows = user_id oxtab.ccolfield = 'cate' && columns = products oxtab.cdatafield = 'nos' && cells = amount oxtab.nfunctiontype = 2 && use COUNT() oxtab.ccondition = "nos > 0" && where amount > 0 *oXtab.lDisplayNulls = .T. && .T. display NULL *oXtab.lBrowseAfter = .T. && .T. only if you want a browse to check the result oxtab.lclosetable = .f. && .T. close the source table oxtab.runxtab() axb=ALIAS() SELECT (AXB) BROWThe codes work fine outside EXE and displays correct result shown in attachment
SELECT (AXB) BROWPlease help