Jump to content

Need help: How do I get totals from a field?


dzingai

Recommended Posts

I am building a simple income and expenditure app for myself, with seperate tables for income and

 

expenditure. The income table looks like the following:

id INT AUTO_INCREMENT PRIMARY KEY,

date DATE,

income1 INT(10) NULL,

icome2 INT(10) NULL,

income3 INT(10) NULL,

income4 INT(10) NULL,

etc

 

What has stumped me is how to extract all the entries and get totals of each field?

 

I want to be able to extract and view totals for each field (eg total_for_field1,

 

total_for_field2, etc) and then add them all to give me the total for all. One option I had was to automatically increment the current amount with the new entry, but I would like to be able to later trace each entry.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.