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 |
|
mark1504
Posting Yak Master
103 Posts |
Posted - 2005-05-26 : 11:27:08
|
| Let's say i have fields in a table: hours (int), minutes (int).What's the best method of returning the time in a string format of, for example: 09:00. In other words, how do I pad a single number with a 0 when necessary?ThanksMark |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2005-05-26 : 11:30:58
|
| RIGHT('00' + CAST(Hours AS VARCHAR), 2) should do it.===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
 |
|
|
mark1504
Posting Yak Master
103 Posts |
Posted - 2005-05-26 : 11:39:09
|
| Thanks GrazRapid response as usual!(I'd been looking for something in CAST or CONVERT and didn't find it.)RegardsMark |
 |
|
|
|
|
|