Replace Function - ISO Alternative

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use the below statement in a query to extract an extension from a phone
number that is stored as (504) 123-4567. However, the "replace" function
seems to be preventing me from sharing this query with another application
via odbc. Is there another way write the below without the replace function?

Ext: IIf([StudioId]="EAC","1" &
Right([PhoneNumber],4),IIf([StudioId]="EAUK",Right([PhoneNumber],5),Replace(Right([PhoneNumber],6),"-","")))

Thanks in advance for your help!
 
cynteeuh said:
I use the below statement in a query to extract an extension from a phone
number that is stored as (504) 123-4567. However, the "replace" function
seems to be preventing me from sharing this query with another application
via odbc. Is there another way write the below without the replace
function?

Ext: IIf([StudioId]="EAC","1" &
Right([PhoneNumber],4),IIf([StudioId]="EAUK",Right([PhoneNumber],5),Replace(Right([PhoneNumber],6),"-","")))

Thanks in advance for your help!


You can use the following statement to remove the "-" from the phone number
(instead of the Replace):

Left([PhoneNumber],InStr([PhoneNumber],"-")-1) &
Right([PhoneNumber],Len([PhoneNumber])-InStr([PhoneNumber],"-"))



--
 
That returns (604) 4563646, but I need the last 5 digits ONLY, 63646. Thx!

Michael J. Strickland said:
cynteeuh said:
I use the below statement in a query to extract an extension from a phone
number that is stored as (504) 123-4567. However, the "replace" function
seems to be preventing me from sharing this query with another application
via odbc. Is there another way write the below without the replace
function?

Ext: IIf([StudioId]="EAC","1" &
Right([PhoneNumber],4),IIf([StudioId]="EAUK",Right([PhoneNumber],5),Replace(Right([PhoneNumber],6),"-","")))

Thanks in advance for your help!


You can use the following statement to remove the "-" from the phone number
(instead of the Replace):

Left([PhoneNumber],InStr([PhoneNumber],"-")-1) &
Right([PhoneNumber],Len([PhoneNumber])-InStr([PhoneNumber],"-"))



--
 
cynteeuh said:
That returns (604) 4563646, but I need the last 5 digits ONLY, 63646. Thx!

I meant replace the "Replace" function in your statement with the statement
I provided. My code is just a replacement for the "Replace" function not
your entire statement.
Michael J. Strickland said:
cynteeuh said:
I use the below statement in a query to extract an extension from a
phone
number that is stored as (504) 123-4567. However, the "replace"
function
seems to be preventing me from sharing this query with another
application
via odbc. Is there another way write the below without the replace
function?

Ext: IIf([StudioId]="EAC","1" &
Right([PhoneNumber],4),IIf([StudioId]="EAUK",Right([PhoneNumber],5),Replace(Right([PhoneNumber],6),"-","")))

Thanks in advance for your help!


You can use the following statement to remove the "-" from the phone
number
(instead of the Replace):

Left([PhoneNumber],InStr([PhoneNumber],"-")-1) &
Right([PhoneNumber],Len([PhoneNumber])-InStr([PhoneNumber],"-"))



--
 
This is about the 3rd or 4th time you've posted this same question. Each
time the question changes slightly. People have been providing answers to
the question as asked and the response has always been 'Well I really want
....".

Rather than taking the time of people who have been responding, maybe you
should think through what you really need and post the right question?
 
Pardon me. My apologies!

As explained in an earlier response to you (Chaim), I had posted the SAME
question under different categories, because I was new to this and wasn't
sure which category was most appropriate or would generate the best response.
The question below may seem similar and is somewhat related, but it was
triggered AFTER I had got my original answer, which worked in Access, but (if
you read below) when I used the query with another app via ODBC, I received
an error message, which is what prompted me to ask for an alternative to the
"replace" function.

I also posted a question to completely remove the symbols as another
alternative to manipulate the data in case there wasn't an alternative to the
replace function or if the alternative didn't work. This would also help to
avoid situations like the above when linking my data to other programs.

I hope that clears up my muliple "similar" postings and any
misunderstandings. I thought through what I needed, but came across
additional glitches once I utilized the help.

Is this forum not for seeking help? I'm not trying to use up other people's
time to no end.

Sincere regards,
Cynteeuh

Chaim said:
This is about the 3rd or 4th time you've posted this same question. Each
time the question changes slightly. People have been providing answers to
the question as asked and the response has always been 'Well I really want
....".

Rather than taking the time of people who have been responding, maybe you
should think through what you really need and post the right question?
--

Chaim


cynteeuh said:
I use the below statement in a query to extract an extension from a phone
number that is stored as (504) 123-4567. However, the "replace" function
seems to be preventing me from sharing this query with another application
via odbc. Is there another way write the below without the replace function?

Ext: IIf([StudioId]="EAC","1" &
Right([PhoneNumber],4),IIf([StudioId]="EAUK",Right([PhoneNumber],5),Replace(
Right([PhoneNumber],6),"-","")))

Thanks in advance for your help!
 
Back
Top