Board index » cppbuilder » Get output query for sum

Get output query for sum


2004-07-18 08:55:44 AM
cppbuilder77
Hi ,
I have a DBGRID connected to a Table component and TQuery (select count(*)
from ...)
and I would like to access this data in DBGRID directly or get this from
query for do an graphic.
Can anybody help me
Many thanks
Julian Andres Montes
 
 

Re:Get output query for sum

Hello JMontes,
To connect any DBGrid to a table you need a DataSource (TDataSource
component) connected to the TQuery . Remember that Count(*) is a SQL group
function and if you want more data than the count value you should have a
GROUP BY clause.
DBGrid1->DataSource = DataSource;
DataSource->DataSet = Query1;
Query1->SQL->Text = "SELECT COUNT(*) FROM database.table";
HTH
Jayme.
"jmontes" < XXXX@XXXXX.COM >escreveu na mensagem
Quote
Hi ,
I have a DBGRID connected to a Table component and TQuery (select
count(*)
from ...)
and I would like to access this data in DBGRID directly or get this from
query for do an graphic.





Can anybody help me
Many thanks



Julian Andres Montes