Append or Update Query - Need assistance PLEASE!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having some issues with append and update queries and I need some help.
I need a query that will pull data from an external data source (Which I can
do) and update my table. Now the external data source table has 20 fields
and the table it is going to update has 25 fields. The extra 5 fields are
populated by the end user via a form and need to be retained after the update
from the external data source. (The end user pulls up the form and view the
20 fields based on the 3 primary keys WorkOrder, WorkCenter, and Item and
then populates the 5 extra fields based on these 3 primary keys). Now the
tricky part is that the WorkOrder and the Item will not change in the
external data source but the WorkCenter may change. So during the update
from the external data source I need to capture these changes as well as new
data added (New WorkOrder, WorkCenter & Item combinations). I am having
trouble with duplicating data etc after the updates. Can some one give me a
hand with the joins and what type of query to use?
 
If you need to ADD new records, then use an APPEND.
If you need to UPDATE existing records, then use an UPDATE.

Link the tables by their primary key or unique index, typically.
 
Below is my Update query. When I make a change to the WorkCenter in the
WO_Tracking_Master table, the WO_Tracking table should pick up the change
after the query is ran. However, it is not picking up the change. Did I
write the query wrong?

UPDATE WO_Tracking INNER JOIN WO_Tracking_Master ON (WO_Tracking.WorkOrder =
WO_Tracking_Master.WorkOrder) AND (WO_Tracking.WorkCenter =
WO_Tracking_Master.WorkCenter) AND (WO_Tracking.ItemBillNumber =
WO_Tracking_Master.ItemBillNumber) SET WO_Tracking.WorkCenter =
wo_tracking_Master.WorkCenter, WO_Tracking.WorkOrder =
wo_tracking_Master.workorder, WO_Tracking.ItemBillNumber =
wo_tracking_Master.itembillnumber, WO_Tracking.ItemBillDescription =
wo_tracking_Master.itembilldescription, WO_Tracking.QtyPlanned =
wo_tracking_Master.qtyplanned, WO_Tracking.QtyOrdered =
wo_tracking_Master.qtyordered, WO_Tracking.WODate =
wo_tracking_Master.wodate, WO_Tracking.WODueDate =
wo_tracking_Master.woduedate, WO_Tracking.SchedStartDate =
wo_tracking_Master.schedstartdate, WO_Tracking.ActualStartDate =
wo_tracking_Master.actualstartdate, WO_Tracking.DateClosed =
wo_tracking_Master.dateclosed, WO_Tracking.SchedCompletionDate =
wo_tracking_Master.schedcompletiondate, WO_Tracking.MakeFor =
wo_tracking_Master.makefor, WO_Tracking.MakeForOrderNumber =
wo_tracking_Master.makeforordernumber, WO_Tracking.QtyComplete =
wo_tracking_Master.qtycomplete, WO_Tracking.Status =
wo_tracking_Master.status, WO_Tracking.IssueMethod =
wo_tracking_Master.issuemethod, WO_Tracking.DeleteFlag = False;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top