MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
SELECT a.tDate , convert(time,a.tTime) tTime , Dist1 = MAX(ISNULL( b.Object_1, 0 )) , Dist2 = MAX(ISNULL( b.Object_2, 0 )) , Dist3 = MAX(ISNULL( b.Object_3, 0 )) FROM tblTimes a JOIN tblObjects b ON a.TimeID = b.TimeID JOIN tblDurations c ON b.DurationID = c.DurationID GROUP BY a.tDate,convert(time,a.tTime)
SELECT a.tDate, a.tTime, MAX(ISNULL(b.Object_1, 0)) AS Dist1, MAX(ISNULL(b.Object_1, 0)) AS Dist2, MAX(ISNULL(b.Object_3, 0)) AS Dist3 FROM dbo.tblTimes AS a INNER JOIN dbo.tblObjects AS b ON a.TimeID = b.TimeID INNER JOIN dbo.tblDurations AS c ON b.DurationID = c.DurationID GROUP BY a.tDate, a.tTime
|SQL Server 2012 r2 - Calulations within stored procedure involving temp tables||6||25|
|Complex SQL statement (at least for me) to insert values into a table using other tables in my database||4||28|
|What's wrong with this T-SQL Foreign Key?||7||39|
|Separate 2 comma delimited columns into separate rows||2||27|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
11 Experts available now in Live!