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 |
|
sonnysingh
Starting Member
42 Posts |
Posted - 2010-04-16 : 03:56:43
|
| Hi AllI need to include in same T-SQL the datetime for 'MaxLQTimeAbdn. This data group by datetime column. And need datetime for max(QTime) means datetime for 16 value of Qtime. HalfHourDateTime DateTime DNIS QTime2010-04-01 02:30:00 2010-04-01 02:51:42 15403 102010-04-01 02:30:00 2010-04-01 02:52:14 15403 16T-SQL as follows:-SELECT @Hnd.RHalfHour, @Abnd.Variable3, COUNT(@Abnd.RCKey) as 'TrueAbandons', SUM(@Abnd.LocalQTime) as 'LocalQTime', MAX(@Abnd.LocalQTime) as 'MaxLQTimeAbdn', FROM @Hnd RIGHT OUTER JOIN @Abnd ON @Hnd.NewRouterCallKey = @Abnd.NewRouterCallKey WHERE @Hnd.NewRouterCallKey is null GROUP BY @Abnd.Variable3 , @Abnd.RHalfHourThanks for HelpSqlIndia |
|
|
Sachin.Nand
2937 Posts |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-16 : 04:15:42
|
Idera is right.In your post there is no question.There is already a select with max(@Abnd.LocalQTime).There is already an error because the last comma before FROM isn't right.You should have posted the error message.You have given a little bit of sample data but you have not given the wanted output. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|