I currently have incoming data that is either SSNs or FIDs (xxx-xx-xxxx or xx-xxxxxxx). The existing data (SSNs and FIDs) does not have the "-" in it, and thus I need to remove the "-" from the incoming data. Any suggestions?
I currently have incoming data that is either SSNs or FIDs (xxx-xx-xxxx or xx-xxxxxxx). The existing data (SSNs and FIDs) does not have the "-" in it, and thus I need to remove the "-" from the incoming data. Any suggestions?
Use the Replace function.
Replace function takes 3 parameters. The Haystack, The Needle, and Needle's replacement.
Replace('999-99-999', '-', '') = 99999999
You can use the replace function in a Query or VBA Code!
Thanks for your help. I actually ended up using the "Mid" function to extract the "xxx", "xx" and "xxxx" from the field, and then pushed it all back into one field without the "-".
You can also use
SSN = substring(SSN,1,3)+substring(SSN,5,2)+substring(SS N,8,4)
FEID = substring(FEID,1,2)+substring(FEID,4,7)
I like the substring method. That would have saved me some time! I will have to remember that one for the future. Thank you.