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 |
|
Madhu_86
Starting Member
1 Post |
Posted - 2011-07-29 : 06:48:00
|
| Hello,I Have following table in SQL.Ticket_No Report_Date1111 2011-06-202222 2011-06-203333 2011-06-214444 2011-06-215555 2011-06-216666 2011-06-22What i want to do is query this table and find out the sql result as following...Count Week_day2 Monday3 Tuesday1 WednesdayMadhu |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-07-29 : 06:58:36
|
| [code]SELECT COUNT(*) as [Count], DATENAME(weekday,Report_Date) as [Week_day]FROM YourTable GROUP BY DATENAME(weekday,Report_Date)[/code] |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-07-29 : 06:58:47
|
SELECT DATENAME(WEEKDAY, Report_Date), COUNT(*) FROM dbo.Table1GROUP BY DATENAME(WEEKDAY, Report_Date) N 56°04'39.26"E 12°55'05.63" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-07-29 : 06:59:08
|
 N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|
|