T
troy
I have 2 tbls, The first tabl (TblOblig) has one ObligID number for
multilple Product ID #'s in tbl 2 (ProductTbl). I want to set up a query
(UPDATE) when a fieled has changed which could be more than one in the Oblig
Tbl, that it only changes the correct field(s) for which that paticular
Product number is associated with in the Oblig table. Because one Unique
ObligID number could be associated to more than one product ID number, I want
the change to reflect the correct ProductID number and not make the change to
all Product #'s and thier fields associated with that Oblig Id#. This is an
update query. Here is my SQL for the query but it reflects a change to all
product numbers associated with the correct Oblig number and not just the one
that it is associated with. PLEASE HELP!
UPDATE dbo_tblObligationType INNER JOIN (DEV_dbo_TblProduct RIGHT JOIN
dbo_TblProduct ON DEV_dbo_TblProduct.ProductId = dbo_TblProduct.ProductId) ON
dbo_tblObligationType.ObligationTypeID = dbo_TblProduct.ObligationTypeID SET
DEV_dbo_TblProduct.ProductId = dbo_tblproduct.productid,
DEV_dbo_TblProduct.BondType = dbo_tblObligationType!BondType,
DEV_dbo_TblProduct.CategoryId = dbo_tblObligationType!CategoryID,
DEV_dbo_TblProduct.ProductLine = dbo_tblObligationType!ProductLine
WHERE (((DEV_dbo_TblProduct.ProductId)=[DBO_TBLPRODUCT].[PRODUCTID]) AND
((DEV_dbo_TblProduct.BondType)<>[dbo_tblObligationType].[BondType])) OR
(((DEV_dbo_TblProduct.ProductLine) Not Like
[dbo_tblObligationType].[ProductLine])) OR
(((DEV_dbo_TblProduct.CategoryId)<>[dbo_tblObligationType].[CategoryID]));
multilple Product ID #'s in tbl 2 (ProductTbl). I want to set up a query
(UPDATE) when a fieled has changed which could be more than one in the Oblig
Tbl, that it only changes the correct field(s) for which that paticular
Product number is associated with in the Oblig table. Because one Unique
ObligID number could be associated to more than one product ID number, I want
the change to reflect the correct ProductID number and not make the change to
all Product #'s and thier fields associated with that Oblig Id#. This is an
update query. Here is my SQL for the query but it reflects a change to all
product numbers associated with the correct Oblig number and not just the one
that it is associated with. PLEASE HELP!
UPDATE dbo_tblObligationType INNER JOIN (DEV_dbo_TblProduct RIGHT JOIN
dbo_TblProduct ON DEV_dbo_TblProduct.ProductId = dbo_TblProduct.ProductId) ON
dbo_tblObligationType.ObligationTypeID = dbo_TblProduct.ObligationTypeID SET
DEV_dbo_TblProduct.ProductId = dbo_tblproduct.productid,
DEV_dbo_TblProduct.BondType = dbo_tblObligationType!BondType,
DEV_dbo_TblProduct.CategoryId = dbo_tblObligationType!CategoryID,
DEV_dbo_TblProduct.ProductLine = dbo_tblObligationType!ProductLine
WHERE (((DEV_dbo_TblProduct.ProductId)=[DBO_TBLPRODUCT].[PRODUCTID]) AND
((DEV_dbo_TblProduct.BondType)<>[dbo_tblObligationType].[BondType])) OR
(((DEV_dbo_TblProduct.ProductLine) Not Like
[dbo_tblObligationType].[ProductLine])) OR
(((DEV_dbo_TblProduct.CategoryId)<>[dbo_tblObligationType].[CategoryID]));