Groundrush
Registered User.
- Local time
- Today, 01:48
- Joined
- Apr 14, 2002
- Messages
- 1,376
I'm trying to create an update query that finds all records with the value of 4 then replace them with the value of 3.
The problem I have is that this query is linked to two tables & is has a one to many relationship.
To try & solve this problem I created another query to hide the duplicates using DISTINCT after the SELECT
then using my update query I linked the main table with the 2nd qry hoping that it would work but I get the same message.
query 1
query2
Any ideas anyone how to achieve this?
thanks
The problem I have is that this query is linked to two tables & is has a one to many relationship.
To try & solve this problem I created another query to hide the duplicates using DISTINCT after the SELECT
then using my update query I linked the main table with the 2nd qry hoping that it would work but I get the same message.
query 1
Code:
SELECT DISTINCT dbo_Project.ProjectRef, dbo_Project.PROJECTSTATUSREF, dbo_vw_KPI_PAYMENT_CUBE.Contractor_Status
FROM dbo_Project RIGHT JOIN dbo_vw_KPI_PAYMENT_CUBE ON dbo_Project.Project_number = dbo_vw_KPI_PAYMENT_CUBE.Project_Number
WHERE (((dbo_Project.PROJECTSTATUSREF)=4) AND ((dbo_vw_KPI_PAYMENT_CUBE.Contractor_Status)="Trade Operative" Or (dbo_vw_KPI_PAYMENT_CUBE.Contractor_Status)="External Contractor"));
query2
Code:
UPDATE qryAssignedUpdate1 LEFT JOIN dbo_Project ON qryAssignedUpdate1.ProjectRef = dbo_Project.ProjectRef SET dbo_Project.PROJECTSTATUSREF = 3
WHERE (((dbo_Project.PROJECTSTATUSREF)=4));
Any ideas anyone how to achieve this?
thanks