I have the following SQL:
;WITH times AS (
SELECT '0830' AS t
UNION
SELECT '0930' AS t
UNION
SELECT '1030' AS t
UNION
SELECT '1130' AS t
UNION
SELECT '1230' AS t
)
SELECT t as time
FROM times
;
When I execute this in SSMS (SQL Server Management Studio), it displayed correctly as
0830 0930 1030 1130 1230
However, when I put this into a drop down list inside Visual Studio 2010, the list becomes incorrectly sorted:
1030 1130 1230 830 930
The 0 is disappearing from the 0830 and 0930 and both 0830 to 0930 is being shifted from the 1st two items in the list to the last two items.
How can I make the drop-down show the list in the correct order?
ORDER BY, this is an application issue, probably something to do with data types and how the list is getting populated. – Jon Seigel Sep 27 '12 at 3:26