Replace " and ' with in. and ft.

  • Thread starter Thread starter 2Blessed4Stress
  • Start date Start date
2

2Blessed4Stress

I have the following in my query:
PART: Replace(Replace(Replace([bm_Data]![PART DESCRIPTION],",","*"),"'","ft.
")," " ","in. ")

I keep getting an error of an invalid syntax.
I'm trying to replace "," with *, the symbols for " in. and 'ft with the
abbrev. and not the symbols.
 
2Blessed4Stress said:
I have the following in my query:
PART: Replace(Replace(Replace([bm_Data]![PART
DESCRIPTION],",","*"),"'","ft.
")," " ","in. ")

I keep getting an error of an invalid syntax.
I'm trying to replace "," with *, the symbols for " in. and 'ft with the
abbrev. and not the symbols.


Try this:

PART: Replace(Replace(Replace([bm_Data].[PART DESCRIPTION],",","*"),"'","ft.
"),'"',"in. ")

Note that I've used single-quotes as the string delimiter for the inch
symbol, but double-quotes for all other string literals. I also changed the
bang (!) for a dot (.), which is more standard syntax, though as far as I
can tell the bang works okay as you had it.
 
Thanks. The single ' instead of " works for the in. (I guess it's an Access
thing)

Dirk Goldgar said:
2Blessed4Stress said:
I have the following in my query:
PART: Replace(Replace(Replace([bm_Data]![PART
DESCRIPTION],",","*"),"'","ft.
")," " ","in. ")

I keep getting an error of an invalid syntax.
I'm trying to replace "," with *, the symbols for " in. and 'ft with the
abbrev. and not the symbols.


Try this:

PART: Replace(Replace(Replace([bm_Data].[PART DESCRIPTION],",","*"),"'","ft.
"),'"',"in. ")

Note that I've used single-quotes as the string delimiter for the inch
symbol, but double-quotes for all other string literals. I also changed the
bang (!) for a dot (.), which is more standard syntax, though as far as I
can tell the bang works okay as you had it.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top