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 |
|
baburk
Posting Yak Master
108 Posts |
Posted - 2009-03-13 : 02:34:23
|
| The below query returns SELECT REPLACE( RIGHT( REPLICATE('0',5 - LEN(5)) + CONVERT(VARCHAR(18), RB.Batch), 5) + '.00', '.', ':') FROM RunningBatch AS RB08:02:0010:00:0006:00:00How can I able to cast this to sys.TimeThanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-03-13 : 03:37:45
|
You can't. First record has an hour of 80 which is not allowed since there are only 24 hours every day. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
baburk
Posting Yak Master
108 Posts |
Posted - 2009-03-13 : 04:01:23
|
quote: Originally posted by Peso You can't. First record has an hour of 80 which is not allowed since there are only 24 hours every day. E 12°55'05.63"N 56°04'39.26"
I had edited my post. Time is within in 24 hours |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-03-13 : 04:20:31
|
SELECT cast(REPLACE( RIGHT( REPLICATE('0',5 - LEN(5)) + CONVERT(VARCHAR(18), RB.Batch), 5) + '.00', '.', ':') as time)FROM RunningBatch AS RB E 12°55'05.63"N 56°04'39.26" |
 |
|
|
baburk
Posting Yak Master
108 Posts |
Posted - 2009-03-13 : 04:38:56
|
quote: Originally posted by Peso SELECT cast(REPLACE( RIGHT( REPLICATE('0',5 - LEN(5)) + CONVERT(VARCHAR(18), RB.Batch), 5) + '.00', '.', ':') as time)FROM RunningBatch AS RB E 12°55'05.63"N 56°04'39.26"
Thanks it works |
 |
|
|
|
|
|
|
|