[AccessD] Update query copy one field to another

KathrynAtGwens kathrynatgwens at socal.rr.com
Thu Jul 29 15:06:12 CDT 2004


Drew, just making sure you got my off list message and that it didn't get caught in a spam filter.
Kathryn

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of
> DWUTKA at marlow.com
> Sent: Thursday, July 29, 2004 12:08 PM
> To: accessd at databaseadvisors.com
> Subject: RE: [AccessD] Update query copy one field to another
> 
> 
> It is probably easier to just think in SQL terms.
> 
> UPDATE tblMyTable SET SomeField=1, SomeOtherField=5*[SomeOtherField],
> SomeTextField=UCase([SomeTextField]), ThisField=ThatField WHERE
> ADateField>#2-13-04#
> 
> If you look at the segments of the SQL, you have the actual 
> command UPDATE.
> After update, you need to let it know what it's updating, which is
> tblMyTable.  Then you need to let it know what you want to update within
> that table, so you have SET.  Everything after SET are comma delimited
> Fields and their new values.  So in the example above, we are setting
> 'SomeField' to 1, SomeOtherField to 5x it's value, 'SomeTextField' to All
> caps, and ThisField is being set to the value in ThatField.  We 
> also have a
> WHERE clause, which tells Jet to only perform this update on records that
> have an ADateField date after the 13th of February of this year.
> 
> Now, if you look at the SQL that Access produces, it will be the same, but
> it will be cluttered with brackets, parentheses and full table references.
> That isn't bad, in fact it may even run just a hair faster (since 
> everything
> is fully named), but it's a nightmare to try and actually see the basics
> being used.
> 
> Drew
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of KathrynAtGwens
> Sent: Thursday, July 29, 2004 1:37 PM
> To: Access Developers discussion and problem solving
> Subject: RE: [AccessD] Update query copy one field to another
> 
> 
> Thanks - I had it backwards - just wasn't getting it.
> 
> Kathryn
> 
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of
> > DWUTKA at marlow.com
> > Sent: Thursday, July 29, 2004 11:23 AM
> > To: accessd at databaseadvisors.com
> > Subject: RE: [AccessD] Update query copy one field to another
> > 
> > 
> > Get rid of the MarrName field, and put [MarrName] in the Update To field
> > under Surname.
> > 
> > Drew
> > 
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of KathrynAtGwens
> > Sent: Thursday, July 29, 2004 12:51 PM
> > To: Access Developers discussion and problem solving
> > Subject: [AccessD] Update query copy one field to another
> > 
> > 
> > I'm just not getting it. Writing SQL statements is not coming to me, so
> > explain this in what I type into the grid view.
> > 
> > Table name - tblCemeteries4Updating
> > Field name - Surname
> > Field name - MarrName
> > 
> > In the update query grid, I have 
> > 
> > Field		MarrName			Surname
> > Table		tblCemeteries4Updating	tblCemeteries4Updating
> > Update To
> > 
> > What do I type into Update To grid in order to copy the contents 
> > of MarrName
> > field into the Surname field? 
> > 
> > (I don't want to change the Surname field to MarrName, as I need both -
> > after doing this copy, I have to manually go through and del the 
> > contents of
> > MarrName from all the males, and add the correct MarrName to all the
> > females, as all the existing contents are "maiden names"}
> > 
> > --
> > Kathryn Bassett (at work address)
> > kathrynatgwens at socal.rr.com
> > kathryn at bassett.net (home) 
> > 
> > -- 
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > -- 
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> 
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list