Query (1 Viewer)

capogna1

Member
Local time
Yesterday, 22:23
Joined
Aug 8, 2019
Messages
46
Hi everyone,
I have a field with social security numbers, data was imported so some came in with dashes some without. Tried to change format to the field to get rid of dashes but didn't work. Now when I search by SSN I have to try with dashes and without. How do I tell Access bring be back either SSN with dashes and without?
Thanks in advance for any response.
Robert
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 10:23
Joined
May 7, 2009
Messages
19,233
how do you search, is there a textbox for search

add asterisk in front and in back of the search string:
Code:
*searchString*
If you're going to create a query that filter with or without dash:
Code:
select * from table where replace([fieldToFilter],"-","") = "filterString"
 
Last edited:

jdraw

Super Moderator
Staff member
Local time
Yesterday, 22:23
Joined
Jan 23, 2006
Messages
15,378
Are you certain you should be using SSN in your application? Could be a privacy issue.

You could remove the dashes in the SSNs with dashes. See the Replace function.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:23
Joined
Oct 29, 2018
Messages
21,467
Hi Robert. Welcome to AWF! You might also consider cleaning up the data so they are consistent. You should be able to do it quickly using an UPDATE query.
 

capogna1

Member
Local time
Yesterday, 22:23
Joined
Aug 8, 2019
Messages
46
Thanks everyone problem solved!
I was able to remove dashes from the raw data.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:23
Joined
Oct 29, 2018
Messages
21,467
Thanks everyone problem solved!
I was able to remove dashes from the raw data.
Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom