Solved

simple Update query

Posted on 2006-07-06
11
288 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 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

696 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