Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2005-05-10 : 17:26:44
|
I have a table looks like: Time count 1AM 13 1PM 313 2AM 110 2PM 5912AM 2412PM 460 I would like to order by .. Time count 1AM 13 2AM 313 12AM 110 1PM 59 2PM 24 12PM 460 How can I do this?I've tried something like: order by substring([time], 1,2) asc, substring([time], 3,4) asc ,but it didn't work |
|
|
AndyB13
Aged Yak Warrior
583 Posts |
Posted - 2005-05-10 : 17:37:45
|
Are you sure about your order - 12AM comes before 1AM same goes for PMYou could do ORDER BY CONVERT(datetime,[Time])But this will output like this12AM 241AM 132AM 11012PM 4601PM 3132PM 59 AndyBeauty is in the eyes of the beerholder |
 |
|
|
|
|
|