Jump to content


Photo

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


  • Please log in to reply
3 replies to this topic

#1 VTS

VTS
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts
  • LocationTennessee

Posted 31 July 2006 - 09:18 PM

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.

#2 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 31 July 2006 - 09:29 PM

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?
Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.

#3 VTS

VTS
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts
  • LocationTennessee

Posted 31 July 2006 - 09:32 PM

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.

#4 VTS

VTS
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts
  • LocationTennessee

Posted 01 August 2006 - 03:51 PM

NVM, I figured it out.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users