?
Solved

simple Update query

Posted on 2006-07-06
11
Medium Priority
?
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 35

Assisted Solution

by:Raynard7
Raynard7 earned 1000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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
 
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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Suggested Courses

764 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