Jump to content

Using "GROUP BY" with dates


Recommended Posts

Hi,I'm trying to create an SQL statement that will return the total amount of money earned in a specific time period such as per day/per week/ per month. Here's the relevant table columns:

table(amount INT NOT NULL,insert_dt DATETIME NOT NULL)

And here's the SQL statement I want to use:

SELECT SUM(amount) FROM table GROUP BY ?

I seem to recall that this is possible, but how? Unfortunately my SQL is a bit rusty.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...