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 |
|
hspatil31
Posting Yak Master
182 Posts |
Posted - 2012-04-17 : 07:45:22
|
| Dear All,I have following query and I am getting following output.If in fist colum last is - then it should remove from the column.Please see the desired outpu.Can anybody plz tell me how resolve this issue ?SELECT('1'+'-'+ISNULL(i.Country_Code,'')+'-'+ISNULL(i.Dialed_Digits,'')) AS INTERNATIONAL,ISNULL(IN.Rate,0) AS RateFROMtb_lcr_ierg i (nolock),tb_lcr_int_nor_r_s IN (nolock),...Output:1-213- 0.12651-355-4 0.03361-355-67 0.3181Desired Output:1-213 0.12651-355-4 0.03361-355-67 0.3181Thanks and Regard'sHarish Patil |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2012-04-17 : 07:52:29
|
SELECT REPLACE(ISNULL('1-' + CountryCode, '') + ISNULL('-' + Dialed_Digits, ''), '- ', ' ') AS InternationalFROM ... N 56°04'39.26"E 12°55'05.63" |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-04-17 : 07:58:04
|
Try:'1'+ISNULL('-'+i.Country_Code,'')+ISNULL('-'+i.Dialed_Digits,'') AS INTERNATIONAL No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-04-17 : 07:58:37
|
 No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
hspatil31
Posting Yak Master
182 Posts |
Posted - 2012-04-17 : 09:17:52
|
| Thanks All, I have resolved the issue.Thanks and Regard'sHarish Patil |
 |
|
|
|
|
|
|
|