G
Guest
The scenario goes like this
I have a linked table and a local table created in the database. I want to
update values in two columns in the local table based on its match in the
linked table. The common column between the two tables has unique row in the
local table and multiple rows in the linked table.
The query used for this purpose is as follows
UPDATE Event_tracker, (SELECT DISTINCT Talon_Staging_Table.MWBNBR,
Talon_Staging_Table.TALONEXTRACTDATETIME
FROM Talon_Staging_Table) as vk
SET Event_tracker.Talstg_event_status = "P", Event_tracker.Talstg_Post_date
=
Format(Mid(vk!TALONExtractdatetime,5,2)+"/"+Mid(vk!TALONExtractdatetime,7,2)+"/"+Mid(vkt!TALONExtractdatetime,1,4)+"
"+Mid(vk!TALONExtractdatetime,10,2)+":"+Mid(vk!TALONExtractdatetime,12,2)+":"+Mid(vk!TALONExtractdatetime,14,2),"mm/dd/yyyy hh:nn:ss AM/PM")
WHERE Event_tracker.Document_Number=vk!MWBNBR And
Event_Tracker.LV_Event_Status="P";
-where Event_tracker is the local table and Talon_staging_table is the
linked table. The columns being updated are Talstg event status which is
hardcoded as "P"
and the other one is a date which is in a different format ( hence the
format changes text to the date)
The reason I am using following query in the update statement is to get the
distinct values is as a result of the error " Operation must use an
updateable query". But the result doesnt change
(SELECT DISTINCT Talon_Staging_Table.MWBNBR,
Talon_Staging_Table.TALONEXTRACTDATETIME
FROM Talon_Staging_Table) as vk
The same thing works if I use a seperate table having the distinct values by
running the above query seperately and then I use a update on them.
Can someone guide me as to how do I fix this.
Thanks
Venky
I have a linked table and a local table created in the database. I want to
update values in two columns in the local table based on its match in the
linked table. The common column between the two tables has unique row in the
local table and multiple rows in the linked table.
The query used for this purpose is as follows
UPDATE Event_tracker, (SELECT DISTINCT Talon_Staging_Table.MWBNBR,
Talon_Staging_Table.TALONEXTRACTDATETIME
FROM Talon_Staging_Table) as vk
SET Event_tracker.Talstg_event_status = "P", Event_tracker.Talstg_Post_date
=
Format(Mid(vk!TALONExtractdatetime,5,2)+"/"+Mid(vk!TALONExtractdatetime,7,2)+"/"+Mid(vkt!TALONExtractdatetime,1,4)+"
"+Mid(vk!TALONExtractdatetime,10,2)+":"+Mid(vk!TALONExtractdatetime,12,2)+":"+Mid(vk!TALONExtractdatetime,14,2),"mm/dd/yyyy hh:nn:ss AM/PM")
WHERE Event_tracker.Document_Number=vk!MWBNBR And
Event_Tracker.LV_Event_Status="P";
-where Event_tracker is the local table and Talon_staging_table is the
linked table. The columns being updated are Talstg event status which is
hardcoded as "P"
and the other one is a date which is in a different format ( hence the
format changes text to the date)
The reason I am using following query in the update statement is to get the
distinct values is as a result of the error " Operation must use an
updateable query". But the result doesnt change
(SELECT DISTINCT Talon_Staging_Table.MWBNBR,
Talon_Staging_Table.TALONEXTRACTDATETIME
FROM Talon_Staging_Table) as vk
The same thing works if I use a seperate table having the distinct values by
running the above query seperately and then I use a update on them.
Can someone guide me as to how do I fix this.
Thanks
Venky