Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete right amount of digits 1

Status
Not open for further replies.

tiver43809

IS-IT--Management
May 6, 2005
72
US
I am trying to come up with a query that will delete the right most digit from a talble sdn and field trans.

For example
My trans = 1847706* I would like to delete the * so my result would be 1847706.
The amount of digits fluctuates so some translated digits may consist of 7 digits other may only be 3. So i do not think I can us Substring?

I've figured out how to select the right most digits.

select right(Trans,1) from sdn

And edit what I want to select.

Select right(Trans,1) from sdn where transl like '%*'

But I can not figure out how to delete just the right most digits. Everything I try and delete either deletes everything but the right or everything but the left.
 
Try...

[tt][blue]Select Left(Trans, Len(Trans)-1)
From YourTable[/blue][/tt]

By combining the len (length) function with the left and right functions, many things are possible.



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
DOH I feel like an idiot. Worked great len is what I was looking for. You are the best.

THANKS

Terry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top