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 |
|
duhaas
Constraint Violating Yak Guru
310 Posts |
Posted - 2010-05-10 : 16:16:33
|
| looking for a way to convert a binary4 field to a time. example i have from db is:0x0E173000The vendors documentation states:Starting from the third character on the left, we represent hours, minutes, and seconds in hexadecimal by two digits each, and ignores the last two digits. For example, 0x083b2600 corresponds to 08:59:38. Any help you folks can provide would be great. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-05-11 : 03:41:31
|
| select cast(substring(col,1,1) as int),cast(substring(col,2,1) as int),cast(substring(col,3,1) as int) from your_tableMadhivananFailing to plan is Planning to fail |
 |
|
|
duhaas
Constraint Violating Yak Guru
310 Posts |
Posted - 2010-05-11 : 08:21:29
|
quote: Originally posted by madhivanan select cast(substring(col,1,1) as int),cast(substring(col,2,1) as int),cast(substring(col,3,1) as int) from your_tableMadhivananFailing to plan is Planning to fail
this works very well for me, i appreciate you taking the time. as always you folks are a great resource for those of us just learning the trade |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-05-11 : 08:54:07
|
quote: Originally posted by duhaas
quote: Originally posted by madhivanan select cast(substring(col,1,1) as int),cast(substring(col,2,1) as int),cast(substring(col,3,1) as int) from your_tableMadhivananFailing to plan is Planning to fail
this works very well for me, i appreciate you taking the time. as always you folks are a great resource for those of us just learning the trade
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|