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 |
|
qutesanju
Posting Yak Master
193 Posts |
Posted - 2010-11-17 : 04:27:11
|
| Using one query i'm getting result asName count TimstampEric 1 11/15/2010 3:24:13 AMEnrique 1 11/15/2010 3:32:28 AMRick 1 11/16/2010 12:31:52 AMRick 1 11/16/2010 12:32:02 AMbut i need to do group by as Name count TimstampEric 1 11/15/2010 Enrique 1 11/15/2010 Rick 2 11/16/2010 ignoring timstamp and it should group based on date only |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-11-17 : 04:34:00
|
Which SQL Server Version are you using?Is it 2008 or earlier? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-11-17 : 04:34:10
|
| select name,count(count),CONVERT(varchar(20),Timstamp,110)from yourtablegroup by name,CONVERT(varchar(20),Timstamp,110)PBUH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-11-17 : 04:36:45
|
| Post the query that you have usedMadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-11-17 : 04:38:35
|
| select name,count(count),dateadd(day,datediff(day,0,datecol),0) from yourtablegroup by name,dateadd(day,datediff(day,0,datecol),0) MadhivananFailing to plan is Planning to fail |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-11-17 : 05:05:48
|
| SELECT Name, SUM([Count]) [Count], Timstamp FROM (SELECT Name, [Count], CONVERT(VARCHAR(10), Timstamp, 101) Timstamp FROM TestTable WITH(NOLOCK)) AGROUP BY Name, TimstampVaibhav TIf I cant go back, I want to go fast... |
 |
|
|
qutesanju
Posting Yak Master
193 Posts |
Posted - 2010-11-17 : 06:58:31
|
| great madhivanan,vaibhavktiwari83......it worked!!! |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-12-03 : 06:09:00
|
ThanksVaibhav TIf I cant go back, I want to go fast... |
 |
|
|
|
|
|
|
|