Jump to content

Archived

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

VTS

php and mysql problems...need help with a query---figured it out nvm

Recommended Posts

Ok, I will try to explain this as best as I can.  I have a table with data in it like this:

sda_id    sda_amt   sda_date
   1         23.45      2006-07-21
   2         45.22      2006-07-21
   1         23.90      2006-07-20
   2         46.32      2006-07-20
   1         29.09      2006-07-19
   2         60.06      2006-07-19


and this goes on for a complete week and there are about 40 different total ids.  What I am trying to do with this take the totals for each id and get their sum for a week and then store this new week total in a different table.  This other table will have id, week_amt and date for the headings in it.  I don't really know where to start with this.  If I did not post enough info just let me know and I will try to get a little more detailed.  Thanks for any help in advance.

Share this post


Link to post
Share on other sites
Does the table only contain data for one week, which you want the totals for? Or is there data for more than one week, and you want the totals for each?

Share this post


Link to post
Share on other sites
The sda table contains data by day and it will have data for more than just one week.  Data will get stored into it each day and I want to take this daily data and store it into another table by week so that I have a weekly total field stored.  I want the weekly total for each id.

Share this post


Link to post
Share on other sites
NVM, I figured it out.

Share this post


Link to post
Share on other sites

×

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.