Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Access Update Query

Author  Topic 

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2006-05-26 : 07:44:41
Hi i want to update the table [query_export] where the [Order Reason] = the
[ORDER REASON CODES] in the [Reason_Codes] table.

I want to do this in a SQL Task but the table is a access table.

I tried the query below but it does not work any ideas ?

UPDATE query_export INNER JOIN Reason_Codes ON query_export_.[Order Reason] = Reason_Codes.[ORDER REASON CODES] SET query_export.Reason_code_description = Reason_code.description;

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-05-26 : 09:18:27
U have lot of typo errors :

UPDATE query_export
INNER JOIN Reason_Codes ON query_export_.[Order Reason] = Reason_Codes.[ORDER REASON CODES]
SET query_export.Reason_code_description = Reason_code.description;


Also is this running in MS SQL Server or in Access ?

Srinika
Go to Top of Page

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2006-05-26 : 10:20:00
Sorry here is the query. i got it to work its Friday what can i say !!!!!

Am running this from a SQL TASK on SQL Server but its connection is to a Access database.
So the update is being done on a Access Table


UPDATE query_export INNER JOIN Reason_Codes ON
query_export.Order_Reason = Reason_Codes.ORDER_REASON_CODES
SET query_export.Reason_code_description = [Reason_codes].[DESCRIPTION]
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-05-26 : 11:15:59
try

UPDATE query_export
SET Reason_code_description = r.[DESCRIPTION]
From query_export q
INNER JOIN Reason_Codes r ON
q.Order_Reason = r.ORDER_REASON_CODES


Srinika
Go to Top of Page
   

- Advertisement -