Filtering Social Security # Problem

AB7780

Board Regular
Joined
Apr 22, 2004
Messages
56
Hello,

I have a database, where one column is Social Security numbers. Some records have just a "0", some have the last 4 digits "3214" or some have 9 digits.

Is there any way I can filter to just show the records with the 9 digit SS# number, and not show others?

I apologize if this is a dumb question. Usually the data I deal with can be handled in Excel, but this set is large, forcing me to struggle with Access.

Thanks so much!
Andrew
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Two options I can think of.
Easy Option 1
Just open the table and do a sort on that SSN field, then roll the screen down until you get to the valid SSN and highlight from there to the end of the table. Copy and paste to Excel?

Harder Option 2
You will need to setup a query.
Build a custom Field like this.

Test:iif(len([SSN#]=9,"Yes","")

Criteria for Test:
"Yes"

PS-If your SSN# has spaces, you will need to change the 9 to whatever the lenght should be.
Our format is
### ### ###
I'm not sure about yours.
 
Upvote 0
You can use len in a parameter to limit the results of a query.

Mike

Code:
SELECT fld1, fld2, fld3
FROM tblName
WHERE Len([fld1])=9;
 
Upvote 0
you can also put Len([fld1])=9 right into your form filter on your table instead of building a query
 
Upvote 0

Forum statistics

Threads
1,221,691
Messages
6,161,310
Members
451,696
Latest member
Senthil Murugan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top