Solved

Format Query to show only right 4 numbers

Posted on 2013-12-18
2
359 Views
Last Modified: 2013-12-18
I have a query that shows 16 text characters (credit card numbers).  the field from the table is formatted as text.

I want my query to show ************1223 as the card number instead of the whole number.  What format characteristics do I have to give this?

I know that in excel there is a RIGHT formula where i specify the number of fields...

My SQL statement looks like this:

SELECT Batchupload.[card type] AS CardType, Batchupload.amount, GetPendingBalances.Name, GetPendingBalances.Account, GetPendingBalances.Email, GetPendingBalances.CardNumber
FROM GetPendingBalances INNER JOIN Batchupload ON GetPendingBalances.ID = Batchupload.[line num]
WHERE (((Batchupload.[batch message])="declined"));

Open in new window


The field i want formatted is GetPendingBalances.CardNumber
0
Comment
Question by:colin911
2 Comments
 
LVL 19

Accepted Solution

by:
jss1199 earned 500 total points
ID: 39728145
Same as Excel :)

=RIGHT([GetPendingBalances.CardNumber],4)

reference: http://www.techonthenet.com/access/functions/string/right.php
0
 

Author Closing Comment

by:colin911
ID: 39728152
awesome!  thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now