MSSQL Sorting Woes
I'm trying to retrive the top 5 rows of a table based on the column "DateAdded" whose value is supplied via an ASP.NET script when a new row is inserted into the table. Currently when I run the SQL statment all works well except for the fact that it assumes that one digit days are newer than 2 digit days, so:
It will show 11/5/2008 before it shows 11/12/2008
11/1/2008 11/20/2008
here is my current statment:
I'm trying to retrive the top 5 rows of a table based on the column "DateAdded" whose value is supplied via an ASP.NET script when a new row is inserted into the table. Currently when I run the SQL statment all works well except for the fact that it assumes that one digit days are newer than 2 digit days, so:
It will show 11/5/2008 before it shows 11/12/2008
11/1/2008 11/20/2008
here is my current statment:
Code:
SELECT TOP (5) PlaceId, UserId, PlaceName, PlaceLocation, PlacedDateAdded
FROM places_table
ORDER BY PlacedDateAddedDESC






