Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dbgrid with sum footer

Status
Not open for further replies.

Aslave

Programmer
Jan 16, 2007
5
0
0
MK
Hi !

I need dbgrid with footer to display the sum, of adecuate colone of dbgrid...of course for free.
 
use a union query that contains the detail and total as the source of the DBGrid:
Code:
SELECT Customer.CustomerID, SUM(OrderAmt) FROM Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID GROUP BY Customer.CustomerID
UNION
SELECT 'Total', SUM(OrderAmt) FROM Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top