Re: Question about replace and _tally

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John Germany (nospamoglethorpesupply_at_earthlink.net1)
Date: 07/05/04


Date: Mon, 5 Jul 2004 18:41:48 -0400


_tally returns the number of records actually processed.

I tried,

replace all MyField with iif(MyField = "find me","replace with me",MyField)
but it also returns the totat reccount.

It seems if you do not use a function in the replace clause it returns the
correct amount of records affected. I'll leave this one to someone else!

try
replace all MyFied with "replace with me" for myfield = "find me"
? _tally

John.

"Jim" <DontEvenBother@hotmail.com> wrote in message
news:bd431690.0407051241.13cb4605@posting.google.com...
> Greetings!
>
> I am trying to obtain the number of records modified by the REPLACE
> command using _TALLY, but I am getting unexpected results.
>
> My command is: REPLACE ALL MyField WITH STRTRAN("find me", "replace
> with me")
>
> Unfortunately, _TALLY returns a number equal to the total number of
> records in the table regardless of how many meet the condition
> setforth in the STRTRAN function.
>
> It doesn't seem logical that an iteration would be counted when the
> condition is not met and thus nothing really gets replaced.
>
> Is this by default -- i.e. _TALLY simply counts the total number of
> attempts? Is the only condition that would force _TALLY to skip
> counting records one that follows a FOR clause?
>
> For example, I can reword the command as follows:
> REPLACE MyField WITH STRTRAN("find me", "replace with me") FOR "find
> me" $ MyField
>
> But that seems redundant and probably slower. Is that the only way?
> Any other insight would be appreciated.
>
> Thanks,
> Jim



Relevant Pages

  • Question about replace and _tally
    ... command using _TALLY, but I am getting unexpected results. ... counting records one that follows a FOR clause? ... I can reword the command as follows: ... REPLACE MyField WITH STRTRAN ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Update problem ADO vbnet 2005
    ... due to optimistic record locking. ... scotty, before executing the .Update command, determine what the SQL ... text of the command is. ... Where clause is so specific that it fails to find the record to update, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Limit on Access where clause?
    ... Microsoft Access query specifications Attribute Maximum ... Number of characters in a cell in the query design grid 1024 ... Access had a limit of 99 fields in the where clause. ... a select command that retrieves rows to a OleDbDataAdapter dataset? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Check Box Use As Criteria
    ... you want to return only the records where MyField ... Switch your query to SQL View ... Change the WHERE clause so it looks like this: ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.queries)
  • Re: Check Box Use As Criteria
    ... Datasheet view I get a pop-up asking for MyFied value. ... > If it is checked, you want to return only the records where MyField ... > Switch your query to SQL View ... > clause evaluates to True, and if the WHERE clause evaluates to True for all ...
    (microsoft.public.access.queries)