I have the following setup, but when you review the results, they arent ordered correctly. Since the date was converted to varchar, it puts the dates in numerical order.. instead of actual date order.. but if i switch the order by to this, it complains that
its not contained in aggregate function bla bla bla.. how can i truely order the results by date and still have my group by conditons.
ORDER BY EventRptDate DESC
GROUP BY NodeId,CONVERT(VARCHAR(10),EventRptDate, 101),FirmwareVersion,OverallHealth
ORDER BY CONVERT(VARCHAR(10),EventRptDate, 101) DESC
Intermediate ASP.net User, Using VS2008/VS2010 with C# and SQL2005, SQL2008, Silverlight 3
---------------------
Mark as Answered if it helped
cubangt
Contributor
3052 Points
2402 Posts
why wont my order by work when i have group by before it
Apr 18, 2011 04:34 PM|LINK
I have the following setup, but when you review the results, they arent ordered correctly. Since the date was converted to varchar, it puts the dates in numerical order.. instead of actual date order.. but if i switch the order by to this, it complains that its not contained in aggregate function bla bla bla.. how can i truely order the results by date and still have my group by conditons.
ORDER BY EventRptDate DESC
---------------------
Mark as Answered if it helped