Re: How to add to a new field based on information in existing field?

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

From: Brendan Reynolds (brenreyn)
Date: 09/29/04


Date: Wed, 29 Sep 2004 17:40:00 +0100

I think you'd be better to add a table with the French descriptions and use
a query to join the two tables. For example, Table1 includes fields TestID
and Description, Table2 includes fields Description and DescriptionFr. The
following query will list all records in Table1 with any matching records in
Table2. Note the user of an outer join - otherwise the query would exclude
any records from Table1 that had no matching record in Table2.

SELECT Table1.*, Table2.DescriptionFr
FROM Table1 LEFT JOIN Table2 ON Table1.Description = Table2.Description;

-- 
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com
The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
"Ara" <Ara@discussions.microsoft.com> wrote in message 
news:56C77986-E323-4A71-93EF-666ACF114531@microsoft.com...
>I still really need some help with this - should I be asking in another 
>forum?
>
> "Ara" wrote:
>
>> Hi, I'm stuck and need advice on how to do the following:
>> I have a table that contains a field "Description" and I have added a new
>> field "DescriptionFr".  I need a command that will search the existing
>> records, and place information into the new field based on a legend of 
>> sorts
>> that I will create.  For example, if the record contained an entry in the
>> Description field that = "red", the command would then enter "rouge" into 
>> the
>> DescriptionFr field for that record.  I would specify (somewhere?) the 
>> words
>> to search for and the appropriate translation to be entered into the new
>> field.
>> I will also need to be able to edit the "legend" as there could be new 
>> words
>> added in the future.
>> Any help would be greatly appreciated!  I did try searching the boards, 
>> but
>> couldn't seem to find anything like this.
>> 


Relevant Pages

  • Re: Incredibly slow query when asking for specific row, but not when asking f?r *
    ... table1.*, table2.*) is very quick, querying for any specific fields is ... What are the query plans? ... Probably the second query gives poor performance because a not so ...
    (comp.databases.sybase)
  • Re: Extract trades that do NOT match the other table
    ... HOW do you determine which records in Table1 MATCH a record in Table2? ... Assuming that ID and Name both must match then try the following query. ... All trades from before till now. ...
    (microsoft.public.access.queries)
  • Re: Query that will look for duplicate in two tables.
    ... I ran a Find Unmatched Query using name in both tables. ... SELECT Table1.* ... LEFT JOIN Table2 ... People table with fields PersonID (primary key), LastName, FirstName, ...
    (microsoft.public.access.queries)
  • Re: Specify the table containing the records you want to delete
    ... It might be faster if there were only a few records in Table1 and a lot of records in table2. ... WHERE Table1.PrimaryKeyField IN; ... NOTE there is only ONE table in the FROM clause of the Delete query. ...
    (microsoft.public.access.queries)
  • Re: Tricky Visual Basic Code help...
    ... moves the current record into a new record in table2. ... this with a little VBA code and a couple custom queries. ... Set a "pushFlag" column in the record in table1 to a specific ... If a duplicate is not found, ...
    (microsoft.public.access.formscoding)