Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Format Query to show only right 4 numbers

Posted on 2013-12-18
2
376 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

829 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