Jump to content

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


VTS

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.
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.