Solved

simple Update query

Posted on 2006-07-06
11
284 Views
Last Modified: 2008-02-01
Sorry Brain freeze - Help with simple Update query

Easy 500 Points for the right answer.

I always get this confused.

I want to update the Cardtype in table 1 with the value of Cardtype in table2 where the month =0 and the regions match.

What is the correct syntax.

thanks,

Karen
0
Comment
Question by:Karen Schaefer
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 35

Assisted Solution

by:Raynard7
Raynard7 earned 250 total points
ID: 17055160
UPDATE table1 INNER JOIN table2 ON table1.region = table2.region  SET table1.cardtype = table2.cardtype
WHERE (((table2.month)="0"));
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 17055183
?
UPDATE Table1 INNER JOIN Table2 ON Table1.Region = Table2.Region SET Table1.CardType = Table2.CardType WHERE (((Table2.month)=0));
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 17055185
sorry Ray...I'm too slow!
:o)
0
 

Author Comment

by:Karen Schaefer
ID: 17055192
Sorry I always get mixed up which table is table1 the table the data is being updated or the table where the data is coming from?

K
0
 

Author Comment

by:Karen Schaefer
ID: 17055199
My tables names are

UMA_SUBS.cardtype data I want to update
UMAPERF_MN.WSSCARDTYPE where the data is coming from.

Thanks,

K
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 35

Expert Comment

by:Raynard7
ID: 17055207
UMA_SUBS.cardtype data I want to update - table 1
UMAPERF_MN.WSSCARDTYPE where the data is coming from. - table 2 (as this has the where statement)
0
 

Author Comment

by:Karen Schaefer
ID: 17055240
M_region       M_Node        Load Type      Month      UMA_Subs      CardType
Atlanta       ATMSS995       MSS/UNC      0      3554      
Chicago       CHMSS965       MSS/UNC      0      3554      
Seattle       SEMSS994       MSS/UNC      0      3554      
Houston       HNMSS983       MSS/UNC      0      53554      
Orlando       ORMSS963      MSS/UNC      0      153554      
Denver       DNMSS935       MSS/UNC      0      253554      
Detroit       DEMSS931       MSS/UNC      0      153554      
Dallas       DAMSS986       MSS/UNC      0      353554      
Los Angeles      IRMSS002      MSS/UNC      0      553554      

UMA_Subs Table Data

I want to update the Cardtype in UMA_Subs where the Month = 0  and the M_Region = UMAPERF_MN.M_Region
withh the data from UMAPERF_MN.WSSCARDTYPE

K
0
 
LVL 8

Accepted Solution

by:
infolurk earned 250 total points
ID: 17055261
Usint Raynards query and your info;
UPDATE UMA_Subs INNER JOIN UMAPERF_MN ON UMA_Subs.M_Region = UMAPERF_MN.M_Region  SET UMA_SUBS.cardtype = UMAPERF_MN.WSSCARDTYPE
WHERE (((UMA_Subs.month)="0"));

Cheers
Steve
0
 

Author Comment

by:Karen Schaefer
ID: 17055265
Thanks thats great - you both can share the points.

Karen
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 17055266
update
  UMA_Subs inner join UMAPERF_MN on UMA_Subs.M_Region = UMAPERF_MN.M_Region SET UMA_Subs.Cardtype = UMAPERF_MN.Cardtype Where UMAPERF_MN.Month = 0
0
 
LVL 8

Expert Comment

by:infolurk
ID: 17055318
Cheers.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now