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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-04-08 : 09:17:43
|
| Ozlem Yener writes "I have numbers, names and date. I put the sql sentence below. What I would like to do is group month and put it in a column and Sort it by month?. In access 2000 I can use format$ function for date is there any way to do this in SQL 2000. Thank you in advance.OzlemSELECT purchasedate, CONVERT(CHAR(10),CAST(purchasedate -2 as smalldatetime),103) as purchasedate, month(purchasedate) as purchasedatebymonth" |
|
|
drymchaser
Aged Yak Warrior
552 Posts |
Posted - 2004-04-08 : 11:00:53
|
| What's this for? |
 |
|
|
nricardo
Starting Member
17 Posts |
Posted - 2004-04-08 : 13:20:45
|
| look up the datepart and datename functions |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-04-08 : 15:17:13
|
| SELECT purchasedate, DATEPART(mm,purchasedate) AS purchasemonthFROM purchaseinfoGROUP BY DATEPART(mm,purchasedate)MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|
|
|