473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

strip numeric portion of a string

9
Hello,

I would like to know how to get only the last 7 characters of a string of 22 varchar

my string can be:

3027777777450A80000001

or

A027777777450550000001

but the last 7 characters will always be numbers.


Thank you for your help.
Nov 30 '07 #1
2 1893
Jim Doherty
897 Expert 512MB
Hello,

I would like to know how to get only the last 7 characters of a string of 22 varchar

my string can be:

3027777777450A80000001

or

A027777777450550000001

but the last 7 characters will always be numbers.


Thank you for your help.

SELECT right([yourfieldname],7) AS Mychars FROM yourtablename

will give you the extreme rightmost seven characters aliased to a column name of mychars

Jim :)
Dec 1 '07 #2
pelusa
9
Thanks Jim! that worked so far :-)
Dec 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: PK9 | last post by:
I have a string variable that holds the equivalent of a DateTime value. I pulled this datetime from the database and I want to strip off the time portion before displaying to the user. I am...
6
by: Mark C | last post by:
All, Is there such a function that can strip all non alpha ( not between a-z) characters from a string? I have a function that I currently use that will strip one character at a time from a...
3
by: MattB | last post by:
Is there simple way to take a string that should be all numeric (like a credit card number) and strip out anything that isn't a digit? In the past I've done this in VFP using the IsDigit()...
2
by: DevDave | last post by:
Does anyone know of a quick method to extract just the numeric portion of a string without looping through each character? For instance: 674h23i -> 67423 23-112 -> 23112 87 (21) -> 8721...
3
by: Tim Groulx | last post by:
Hello, I need to be able to select only the numeric data from a string that is in the form of iFuturePriceID=N'4194582' I have the following code working to remove all the non-numeric text...
1
by: shijith | last post by:
Hi, I am using MS-SQL 2000. I had a varchar column with data formated as Numeric portion + Alpha portion. Id ---- 1 2AA 2DF 2AB
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.