Query to Display Partial Field?

  • Thread starter Thread starter Steve-O
  • Start date Start date
S

Steve-O

How would one build a query to display only the last four
digits of someone's SS# even though the field actually
has all nine digits?

Thanks
 
Hi,


If it is a number, you can integral divide, \ , by 100 000

? 987654321 \ 100000
9876



Hoping it may help,
Vanderghast, Access MVP


Fredg said:
LastFour:Right([SS#],4)

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Steve-O said:
How would one build a query to display only the last four
digits of someone's SS# even though the field actually
has all nine digits?

Thanks
 
Many thanks
-----Original Message-----
LastFour:Right([SS#],4)

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Steve-O said:
How would one build a query to display only the last four
digits of someone's SS# even though the field actually
has all nine digits?

Thanks


.
 
Okay, what am I doing wrong? Thanks!

SELECT [EMPLOYEE INFO].[Employee Name], [EMPLOYEE
INFO].SSN
FROM [EMPLOYEE INFO]
WHERE ((([EMPLOYEE INFO].SSN)=LastFour:Right([SSN],4)));




-----Original Message-----
LastFour:Right([SS#],4)

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Steve-O said:
How would one build a query to display only the last four
digits of someone's SS# even though the field actually
has all nine digits?

Thanks


.
 
Hi,



Try, instead:



SELECT *
FROM [Employee Info]
WHERE ssn LIKE [Enter the first four digits of the SSN: ] & "*"


or


SELECT [Employee Name], Left( ssn, 4) As FirstFour
FROM [Employee Info]


The first query acts like a filter (display only the SSN that starts
with the first four given number as parameter), while the second just
display the first four digits of the SSN (such as for some security
reasons). It is not clear what you want to do between those two options.


Hoping it may help,
Vanderghast, Access MVP



Steve-O said:
Okay, what am I doing wrong? Thanks!

SELECT [EMPLOYEE INFO].[Employee Name], [EMPLOYEE
INFO].SSN
FROM [EMPLOYEE INFO]
WHERE ((([EMPLOYEE INFO].SSN)=LastFour:Right([SSN],4)));




-----Original Message-----
LastFour:Right([SS#],4)

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Steve-O said:
How would one build a query to display only the last four
digits of someone's SS# even though the field actually
has all nine digits?

Thanks


.
 
Back
Top