Re: Update query
From: John Spencer (MVP) (spencer4_at_comcast.net)
Date: 01/02/05
- Next message: Brigitte P: "Thanks, and sorry about repeated postings"
- Previous message: doyapore: "Re: need help with query"
- In reply to: Steve: "Update query"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 02 Jan 2005 09:07:26 -0500
Several methods. But probably the best is to build a table of equivalents and
then use that in your update query.
tblEquivalents
--fldCurrent (Jon, Ed, Dave, ...)
--fldNewValue(Jonathan, Edward, David, ...)
Now, you can use that to update your existing table by joining the Existing
table to the table of equivalents based on a join between the First_Name and
fldCurrent. The new value would be fldNewValue. The SQL would look something
like (UNTESTED SQL):
UPDATE ExistingTable As E INNER JOIN tblEquivalents as N
ON E.First_Name = N.fldCurrent
SET E.First_Name = N.fldNewValue
Other methods would use the Switch Function or nested iff statements and are not
nearly as flexible.
Steve wrote:
>
> How do I go about developing an update query to update the same column
> in a table based on several criteria?
>
> For example, in the first_name column I'd like to update Jon to
> Jonathan, Ed to Edward, Dave to David, Frank to Franklin, etc.
>
> Can a single update query do this? Using Access 2002.
>
> Thanks.
>
> Steve
- Next message: Brigitte P: "Thanks, and sorry about repeated postings"
- Previous message: doyapore: "Re: need help with query"
- In reply to: Steve: "Update query"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|