Use SysQuery::countTotal
Example: query = new Query(); queryBuildDataSource = query.addDataSource(tableNum(EmplTable)); queryRun = new QueryRun(query); info(int2str(SysQuery::countTotal(queryRun)); From: Axapta-Knowledge-Village@yahoogroups.com [mailto:axapta-knowledge-vill...@yahoogroups.com] On Behalf Of mane.shankar10 Sent: quinta-feira, 15 de janeiro de 2009 02:54 To: Axapta-Knowledge-Village@yahoogroups.com Subject: [Axapta-Knowledge-Village] Re: record count --- In Axapta-Knowledge-Village@yahoogroups.com <mailto:Axapta-Knowledge-Village%40yahoogroups.com> , "dgreatone123" <dgreatone...@...> wrote: > > Hi, > > sELECT count(recid) FROM EmplTable; > > I want to execute the above statement > > but the table will be variable, I will > supply the table name. How can It be done? > > something like this. > > selec count(recid) from tname; > > where tname='EmplTable"; > > Any help will be greatly appreciated. > > regards, hI > D' great USE THE EDT TABLENAME FOR HAVING ALL TABLENAME LOOKUP THEN USE A VARIABLE TO STORE SELECTED TABLE NAME THEN DO AS FOLLOWS common common;; DICTTABLE DT; ; dt=new dicttable(tablename2id(SELECTEDTABLENAME STORED IN VARIABLE)); common=dt.makeRecord(); sELECT count(recid) FROM COMMON; AND IT WILL WORK 100% REGARDS;
<<image001.jpg>>
<<image002.jpg>>