Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 HELP: How to show the total in datagrid view

Author  Topic 

Aramis
Starting Member

13 Posts

Posted - 2009-09-30 : 20:36:51
Hello guys,

I had a SQL database and i want it to show the total not the individual data. But i dont know how to do that in VB.net.

Example database:

LName Fname Date Data
Aramis Pietrus 01/02/2009 12
Aramis Pietrus 01/03/2009 14
Aramis Pietrus 01/04/2009 19
Aramis Pietrus 01/05/2009 21

I want it only the sum of data to show in the datagridview

LName Fname Date Data
Aramis Pietrus 01/02/2009 66

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-01 : 01:17:45
then bring only aggregates in query

SELECT Lname,FName,MIN(Date) AS Date,SUM(Data) AS Data
FROM YourTable
GROUP BY Lname,FName
Go to Top of Page

Aramis
Starting Member

13 Posts

Posted - 2009-10-01 : 21:21:15
thanks a lot
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-02 : 06:23:06
welcome
Go to Top of Page
   

- Advertisement -