TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ajay raju
NA
398
0
how to find out last four characters using substring?
Aug 11 2010 11:59 PM
Hi sir,
i am displaying credit card number in Textbox. my aim display only last four numbers reamaing are display in 'X' symbol.
i am write substring like
SELECT + 'XXXXXXXXXXXX'+ SUBSTRING(CardNumber,13,LEN(CardNumber)) AS CardNumber FROM tbl_CreditcardInfo WHERE ID = @ID
my problem is if card number is 16 digits its work fine, but if cardNO is 15 or 14 digits that time it display only last 3 or 2 numbers
but my aim is if user enter 14 or 15 or 16 any digts it display only last 4 characters. and remaing first characters displayed 'X' mark.
Please give a solution, and where i modify my query.
Thanks.
Reply
Answers (
3
)
How To resolve this ERROR "A potentially dangerous Request.Form value was detected from the client "in ms sql
Need help in database