I have a set of data which has the following format:
LocalDate LocalTime SourceID UtcTimestamp
04/30/2013 09:05:10 sourceID1 2013-04-29 23:05:00.707
04/30/2013 09:34:10 sourceID2 2013-04-29 23:34:00.707
04/30/2013 09:10:56 sourceID3 2013-04-29 23:10:00.067
01/17/2014 10:41:31 sourceID4 2014-01-17 00:41:31.147
I need to sort the above data in the descending format. My first attempt was to 'ORDER BY'the LocatDate and then LocalTime. However, the data type for 'LocalDate' and 'LocalTime' is varchar. Then I attempted the following since UtcTimestamp data type is datetime:
SELECT TOP 10000 ManagementRecords.LocalDate, ManagementRecords.LocalTime, ManagementRecords.SourceSUID, ManagementRecords.UtcTimestamp
FROM DB.dbo.ManagementRecords ManagementRecords
ORDER BY ManagementRecords.UtcTimestamp DESC
However the above does not work. The 'Executing query' process never returns anything. Why? I would really appreciate some help on this.