MySQL Forums
Forum List  »  Newbie

Calc daily total amount for a specified time period
Posted by: Steve Smith
Date: January 07, 2008 05:20PM

Hello,

I have not had a lot of experience with MySql and could use some help. I have a table called deposits with an id, username, amount and created_at. I have a form that allows a user to select a start at and stop at date for the search. What I want to do is select the daily total amount for each day within the selected fields.
For example get the daily totals from Jan 1st 08 to Jan 7th 08.
I know I can get a specific day with
SELECT SUM(amount) As Total
FROM deposits
WHERE created_at > '2007-11-11';
But I can not figure out how to do this for more then one day.

Thanks again.



Edited 2 time(s). Last edit at 01/07/2008 05:22PM by Steve Smith.

Options: ReplyQuote


Subject
Written By
Posted
Calc daily total amount for a specified time period
January 07, 2008 05:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.