Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 20th, 2007, 12:34 PM
Authorized User
 
Join Date: Sep 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default multiple updates in one statement

Hi -

I have the following data in a table -

Code field1 field2
AAA
BBB
BBB
AAA
AAA
CCC

I want to update AAA with A, BBB with B, CCC with C.
I can do this by separate update statements.

But what i'm trying to do is update all the records with a single update statement. Is there a way to do that ?

Thanks for your help.


 
Old December 21st, 2007, 01:05 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Can your try the following

UPDATE WROX
SET Field1 = LEFT(CODE,1)

http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
update multiple columns in an update statement debbiecoates SQL Server 2000 1 August 17th, 2008 04:01 AM
update multiple column based on case statement?? vinod_yadav1919 SQL Server 2000 6 July 3rd, 2008 07:29 PM
multiple sql statement IbrahimSyed SQL Server 2000 5 July 1st, 2005 10:27 AM
Statement for Multiple Filters in SQL mckly Pro VB Databases 1 August 2nd, 2004 01:53 PM
Refer to multiple databases in one SQL statement JimPaum Pro VB Databases 5 June 25th, 2003 08:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.