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 |
|
eem_2055
Yak Posting Veteran
69 Posts |
Posted - 2007-12-11 : 22:06:03
|
Hi Guys,Can you help me.. I want to convert this table FromNo. LineNo01 302 0ToNo. LineNo01 0302 00What query should I do?Thanks,DUDZ |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-12-11 : 22:07:32
|
what is the data type for column LineNo ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
eem_2055
Yak Posting Veteran
69 Posts |
Posted - 2007-12-11 : 22:13:02
|
| I execute this query to first then after this is the conversion of the line number. Datatype is smallint'LineNO' = isnull(C.[LineNo],'0'), |
 |
|
|
eem_2055
Yak Posting Veteran
69 Posts |
Posted - 2007-12-11 : 22:20:52
|
| datatype is smallint |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-12-11 : 22:23:15
|
[code]right('00' + convert(varchar(10), isnull(c.[LineNo], 0)), 2)[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
eem_2055
Yak Posting Veteran
69 Posts |
Posted - 2007-12-11 : 22:54:19
|
| Thanks.. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-12 : 01:23:56
|
| Formation matters mostly in front endOther methodreplace(str(coalesce([Line_no],0),2),' ','0')MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|