I have a phone number containing the area code, a dash after the area code, and a dash after the prefix. I would like to remove both dashes and remove the area code. Both would be replaced with a null character so a phone number 999-123-4567 would be 1234567 instead.
To this, I have two separate expressions that do what I want. However, I am unable to combine into one compound expression. I have used AND and & to combine them. The first returns a -1, the latter returns a long string (the concatenate).
Here is my two separate expressions that I'd like to combine so I have the dashes and area code removed:
This removes the hyphen, replaces with null value.
This removes the area code by selecting seven characters from the RIGHT of the field.
I'm not exactly sure how to write expressions in SQL, so I merely used the Access query list (I have the most experience with SELECT statements).
To this, I have two separate expressions that do what I want. However, I am unable to combine into one compound expression. I have used AND and & to combine them. The first returns a -1, the latter returns a long string (the concatenate).
Here is my two separate expressions that I'd like to combine so I have the dashes and area code removed:
Code:
Expr1: Replace([PhoneNumber],"-","")
This removes the hyphen, replaces with null value.
Code:
Expr2: Right([PhoneNumber],7)
This removes the area code by selecting seven characters from the RIGHT of the field.
I'm not exactly sure how to write expressions in SQL, so I merely used the Access query list (I have the most experience with SELECT statements).