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 |
|
rcr69er
Constraint Violating Yak Guru
327 Posts |
Posted - 2008-05-20 : 04:10:51
|
| I know this sounds like a basic question, but how do u add a leading 0 to a number, ie, 43 becomes 043Thanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-20 : 04:30:18
|
SELECT '0' + CAST(Col1 AS VARCHAR(12))FROM Table1 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
rcr69er
Constraint Violating Yak Guru
327 Posts |
Posted - 2008-05-20 : 04:36:20
|
| Can this be done in a numeric datatype? |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-20 : 04:45:36
|
Try... E 12°55'05.25"N 56°04'39.16" |
 |
|
|
rcr69er
Constraint Violating Yak Guru
327 Posts |
Posted - 2008-05-20 : 05:08:41
|
| Hey ThanksIs there anyway to store it in a table as numeric datatype with the leading 0?Thanks |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-20 : 05:18:38
|
No. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-05-21 : 07:31:07
|
quote: Originally posted by rcr69er Hey ThanksIs there anyway to store it in a table as numeric datatype with the leading 0?Thanks
You should use varchar datatypeBut consider doing the formation at the front end applicationMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|