Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 get data by month

Author  Topic 

cr488
Starting Member

23 Posts

Posted - 2007-08-10 : 20:07:01
Hi,

I need your help with this one:

How am I going to get full year data by person, by month and sum the amount

Select name, date, sum(amount)
from table
group by name, date

how am I going to group the data by month of the date from Access datbase? Thanks a lot for your help!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-11 : 04:40:06
Select name, year(date), month(date), sum(amount)
from table
group by name, year(date), month(date)



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-11 : 04:41:36
Moderator, please move this topic to ACCESS forum.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -