To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here

HOME News MS SQL Oracle DB2 Access MySQL PHP Scripts Books Links DBA Talk


Go Back   Database Journal Forums > Related Sites > SQL Course

SQL Course SQL Course > Ask questions about the lessons on SQL Course 1 and 2. If you have problems > with the interface, please post in the Feedback forum

Reply Post New Thread
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-06-2002, 07:48 AM
minckle minckle is offline
Registered User
 
Join Date: Nov 2002
Posts: 13
update query with 2 tables

please can someone help

i have two tables with info in
is it possible to update a record in one table with a record from anoher table

this is the code to do it in MS Access

UPDATE tblPromo, tblCurrentUser
SET tblPromo.PromoOperator = [UserName]
WHERE (((tblPromo.PromoOperator) Is Null));

i want to get the username from the tblcurrentuser and put it in Promooperator in tblPromo where PromoOperator is null

hope someone can undesrtand me and help
thanks
Reply With Quote
  #2  
Old 11-12-2002, 12:04 PM
sduggan sduggan is offline
Junior Member
 
Join Date: Nov 2002
Posts: 4
I think the missing link here is join information between the two tables tblCurrentUser and tblPromo.

perhaps this might work (if you file in the gaps):

update tblPromo
set tblPromo.PromoOperator = tblCurrentUser.UserName
from tblPromo
join tblCurrentUser
on tblPromo.<pkid?> = tblCurrentUser.<fkid?>
where tblPromoOperator is null

I have assumed the tables are joined via pk and fk, but so long as a valid join and be made the join method should be valid.

Cheers sduggan...
Reply With Quote
  #3  
Old 11-13-2002, 06:30 AM
minckle minckle is offline
Registered User
 
Join Date: Nov 2002
Posts: 13
thanx 4 ur help ill give it a try
Reply With Quote
Reply Post New Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:17 AM.


DatabaseJournal Recent Articles


 » Grouping with SQL Server 2008

 » Conducting Service Broker Conversation Usi...

 » Applying data warehousing principles to ev...

 » Oracle New Year's resolutions, part 1: Adv...

 » Hands on: Understanding SQL queries

Search Database Journal:
 





Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.