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.
| Author |
Topic |
|
FabioEinaus
Starting Member
41 Posts |
Posted - 2006-11-30 : 07:06:22
|
Hi people!I have to do a Select the sum of the ValorTotalFactura on every month and on every year and I searched on the forum but I didn't found that information.Can someone help me?Cheers! |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-30 : 07:15:01
|
| select year(yourdatetimecolumn), month(yourdatetimecolumn), sum(youramountcolumn)from yourtable group by year(yourdatetimecolumn), month(yourdatetimecolumn)order by year(yourdatetimecolumn), month(yourdatetimecolumn)I am amazed Google didn't pick this one up!Peter LarssonHelsingborg, Sweden |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-01 : 03:21:23
|
| >>order by year(yourdatetimecolumn), month(yourdatetimecolumn)You forget your styleorder by 1,2MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|