Re: I Need to replace many text area in a field with replace funct



Yep, exactly.

uberblick wrote:
Thanks for your input. It's really appreciated.

I see your point.

So basically, I should a create a single Query per attribute name that I'd like to replace. And than run them in sequence or use a macro to do the whole sequence.

Is that correct ?

Regards

uberblick

"Smartin" wrote:

Hi uberlick,

Not to discourage you from your quest, but I see no way it is possible. Your suggestion is intriguing but I tried a couple variations on that theme and came up empty.

The UPDATE query will only accept one argument per field. If you concat several REPLACE statements here, they appear to be evaluated as a single boolean value passed to the update. IOW, they will not be executed sequentially. E.g.,

update RedGreen
set color = replace(color, 'r', 'orange') & color = replace(color, 'e', 'blue')

results in FALSE throughout.

Also UPDATE will not allow you to update the same field more than once.

update RedGreen
set
color = replace(color, 'r', 'orange'),
color = replace(color, 'e', 'blue')

is not valid SQL.

Sorry!

<
Totally OT, but I'm compelled to share a picture of mine that suits your nym (^: http://i51.photobucket.com/albums/f400/smartin108/profile/124_2467.jpg
>


uberblick wrote:
If I do an Update Query by using a CONCAT or "&" function to perform several replacements within the same expression and within the max characters limit allowed by the Expression Builder, would it work ??

"Smartin" wrote:

uberblick wrote:
Hello Access Community,

I'm using Access 2003.

I have a generic HTML template for ebay that contains html code.

In that HTML code we have some field or attribute names like {{ORIGINAL TITLE}}, {{GENRE}}, {{MPAA}} etc. that we would like to customize for each SKU.

We would like to create a customized html code per SKU that contains the right attribute values. So in Fact we have to replace all attribute names by their respective attributes values.

Up to now I was able to replace 1 attribute but I don't know how to build my formula to replace 12 attributes within the same string expression.

This an example: <Start Here>Detail1: Replace(Templates!HTML,"{{IMAGE(ITEMIMAGEURL1)}}",[Oztion_Images&Flags]!Filename)<End Here>

The HTML field is a MEMO field.

The expected result would be an append or make table query that will contains fields named "UPC" and "Detail", the customized html code.


I'm using the Expression Builder not VBA.


Thanks in advance for any input.

Your help will be very appreciated since I'm working on that since a week.

Regards

Stephan
I don't think you can replace multiple targets in one sweep. But since you have 12 attributes, a relatively small number and probably fixed, you could create 12 separate expressions.

If you want all 12 expressions to fire from one control, you could put them each in separate queries, create a macro to fire each query in turn, and point the control at the macro.

--
Smartin


--
Smartin



--
Smartin
.



Relevant Pages

  • UPDATE: I Need to replace many text area in a field with replace f
    ... Just to Give you an update, by creating multiple queries it worked. ... uberblick wrote: ... I should a create a single Query per attribute name that I'd ... I have a generic HTML template for ebay that contains html code. ...
    (microsoft.public.access.queries)
  • RE: UPDATE: I Need to replace many text area in a field with replace f
    ... "uberblick" wrote: ... I should a create a single Query per attribute name that I'd ... And than run them in sequence or use a macro to do the whole ... I have a generic HTML template for ebay that contains html code. ...
    (microsoft.public.access.queries)
  • Re: I Need to replace many text area in a field with replace funct
    ... I should a create a single Query per attribute name that I'd ... And than run them in sequence or use a macro to do the whole ... I have a generic HTML template for ebay that contains html code. ...
    (microsoft.public.access.queries)
  • Re: Wanted: Discussion on MSSQL Internals Interview Qustions
    ... Developer for Microsoft's SQL Server team? ... Other inputs the query optimizer uses are the schema ... The C# dataset caching can only cache results from a single query. ... I don't consider these alternatives to stored procedures, ...
    (microsoft.public.sqlserver.programming)
  • Re: String manipulation
    ... I threw together the rooms into my Students table (Student#, LastName, ... >that you have cited will not lend itself to a single query. ... Those queries won't just mean running ...
    (microsoft.public.access.queries)