SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 get rid of symbol character in the field
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ntn104
Posting Yak Master

162 Posts

Posted - 05/04/2012 :  10:47:15  Show Profile  Reply with Quote
Hello,

How do I get rid of some symbol in front of the field name. For example:  ABCD, I just want to display ABCD only.

Thanks,

khtan
In (Som, Ni, Yak)

Singapore
16769 Posts

Posted - 05/04/2012 :  10:50:50  Show Profile  Reply with Quote
is it always the same symbol ? if it is so, you can use replace() to remove it


KH
Time is always against us

Go to Top of Page

ntn104
Posting Yak Master

162 Posts

Posted - 05/04/2012 :  11:02:56  Show Profile  Reply with Quote
yes it always symbol and space after...
and want to get rid space and that symbol...

Thanks,

quote:
Originally posted by khtan

is it always the same symbol ? if it is so, you can use replace() to remove it


KH
Time is always against us



Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
16769 Posts

Posted - 05/04/2012 :  11:06:42  Show Profile  Reply with Quote
so the text that you want is starting from 3rd character ?

substring( <string> , 3, len(<string>) - 2)



KH
Time is always against us

Go to Top of Page

ntn104
Posting Yak Master

162 Posts

Posted - 05/04/2012 :  11:10:10  Show Profile  Reply with Quote
I got error message for this, like missing a parenthesis...st..
select substring(STREET_2 , 3, len(STREET_2) - 2))
from table

what I did wrong? thanks,

quote:
Originally posted by khtan

so the text that you want is starting from 3rd character ?

substring( <string> , 3, len(<string>) - 2)



KH
Time is always against us



Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
16769 Posts

Posted - 05/04/2012 :  11:44:53  Show Profile  Reply with Quote
you have mismatched parenthesis.
See the extra one in red

select substring(STREET_2 , 3, len(STREET_2) - 2))
from table



KH
Time is always against us


Edited by - khtan on 05/04/2012 11:46:14
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22469 Posts

Posted - 05/07/2012 :  07:10:34  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Alternate

right(col,len(col)-2)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

ntn104
Posting Yak Master

162 Posts

Posted - 05/07/2012 :  11:21:12  Show Profile  Reply with Quote
Thanks...it worked now...

quote:
Originally posted by khtan

you have mismatched parenthesis.
See the extra one in red

select substring(STREET_2 , 3, len(STREET_2) - 2))
from table



KH
Time is always against us



Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000