What about a calculated field based on the decimal portion of the internal time representation. Such as:
Create Table #test (
TestDate varchar(9)
)
Insert into #test
Select '0'
union
select '00:22'
union
select '00:39'
union
select '02:19'
union
select '-03:06'
Select TestDate,
case RTRIM(TestDate)
When '0' then 0
else
case left(TestDate,1)
when '-' then CONVERT(decimal(9,6),convert(datetime,substring(RTrim(TestDate),2,8),114)) * -1
else CONVERT(decimal(9,6),convert(datetime,RTrim(TestDate),114))
end
end as SortDate
from #test
where TestDate <> '0'
order by SortDate
[/code]
Output:
-03:06-0.129167
00.000000
00:220.015278
00:390.027083
02:190.096528
Don Urquhart