Jump to content

Using "GROUP BY" with dates


ThePsion5

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

Archived

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

×
×
  • Create New...