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 |
|
pareekfranksoul
Starting Member
26 Posts |
Posted - 2008-12-15 : 04:58:19
|
| Table Structure:id message date 1 hello 2008-12-15 11:30:002 hi 2008-11-15 11:30:003 abcd 2008-11-15 11:30:004 13245g 2008-11-15 11:30:005 by 2008-11-15 11:30:006 boss 2008-10-15 11:30:00Need query which will return results month wise ie:december1 hello 2008-12-15 11:30:00november2 hi 2008-11-15 11:30:003 abcd 2008-11-15 11:30:004 13245g 2008-11-15 11:30:005 by 2008-11-15 11:30:00october6 boss 2008-10-15 11:30:00Thanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-12-15 : 05:14:05
|
I think this is a presentation issue.Is there a way you can group data with your report engine? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
darkdusky
Aged Yak Warrior
591 Posts |
Posted - 2008-12-15 : 05:18:32
|
| SELECT * FROM TableNamewhere -- To use Numeric DatePart(Month,[Date])='12'OR -- To use Month NameDateName(Month,[Date])='December' |
 |
|
|
pareekfranksoul
Starting Member
26 Posts |
Posted - 2008-12-15 : 05:23:23
|
| yes its a presentation issue but can i get it solved with sql query. |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2008-12-15 : 06:13:08
|
| try this i am not sure SELECT DISTINCT DATENAME(MM, date) FROM urtable WHERE DATEPART(mm,date ) = 12SELECT * FROM urtable WHERE DATEPART(mm,date ) = 12 repeat query for all months |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-15 : 07:28:14
|
| just bring data as it is from table and do the formatting at your front end application. Formatting the output is not purpose of sql server. it should be done by your front end code |
 |
|
|
|
|
|