SUM totals of a recordset

SUM totals of a recordset

Postby Marc Vanzegbroeck » Tue Jan 19, 2016 7:27 pm

Hi,

Is it posible to sum the total of field in a recordset?
Now If I wanted the sum I run a query with sum(myfield) as total and it work.

But now I want to show a recordset, and the the client can put a filter on it , and then I want to sum the totals of the filter records.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: SUM totals of a recordset

Postby nageswaragunupudi » Wed Jan 20, 2016 1:02 am

But now I want to show a recordset, and the the client can put a filter on it , and then I want to sum the totals of the filter records.

We need to calculate the sum manually.
If you are using xbrowse, oBrw:MakeTotals() does this work for us.
This is what I do too
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: SUM totals of a recordset

Postby Marc Vanzegbroeck » Wed Jan 20, 2016 7:46 am

So, I do do have to make a loop in the filtered recordset, and sum() the fields?
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: SUM totals of a recordset

Postby nageswaragunupudi » Wed Jan 20, 2016 7:50 am

Yes, but instead of your doing it, xbrowse does it by itself.
Are you not using xbrowse's maketotals facility?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: SUM totals of a recordset

Postby Marc Vanzegbroeck » Wed Jan 20, 2016 8:06 am

No, I do it manualy, because it's a sum of a calculation of 2 fields....

Thanks
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 120 guests

cron