Home » SQL & PL/SQL » SQL & PL/SQL » eliminate leading zeros on text field
eliminate leading zeros on text field [message #189121] Wed, 23 August 2006 05:02 Go to next message
luzippu
Messages: 2
Registered: August 2006
Junior Member
hi

i need to eliminate leading zeros on a text field where some records are numbers and some come as alphanumeric:

T00123456 should return T00123456
000123456 should return 123456
000123050 should return 123050

any help is appreciated

i'm retrieving data from an oracle db v. 8 on an ssis package (sql sever 2005)

thank you
Re: eliminate leading zeros on text field [message #189125 is a reply to message #189121] Wed, 23 August 2006 05:06 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
SQL> select ltrim('00123455','0') from dual;

LTRIM(
------
123455
icon14.gif  Re: eliminate leading zeros on text field [message #189198 is a reply to message #189125] Wed, 23 August 2006 10:41 Go to previous message
luzippu
Messages: 2
Registered: August 2006
Junior Member
spot on. thank you very much
Previous Topic: Identifying access privileges
Next Topic: transform field
Goto Forum:
  


Current Time: Tue Dec 03 14:23:48 CST 2024