Why does this happen? Please help!

T

troy

I have 2 queries set up. One to filter out the latest changes of data and the
other to drop the changed data into a table. In my query I have two tables.
One source and one target. If someone updates a field in the table (could be
more than one field at a time) I want it to update field in the target
table. I show the table (source) has the changed data and the query shows the
correct amount of records that were changed but the data is not correct.
Sometimes it shows data from the target table and not the source. I have
tried everything and sometimes it is corrrect and sometimes not. So simple
query, relations etc but ???? Please help! I have included my SQL if that
will help?

UPDATE DEV_dbo_TblProduct RIGHT JOIN tblProductVersionRefill ON
DEV_dbo_TblProduct.ProductId = tblProductVersionRefill.ProductId SET
DEV_dbo_TblProduct.ProductId = TblProductVersionRefill.ProductId,
DEV_dbo_TblProduct.RateCode = TblProductVersionRefill!RateCode,
DEV_dbo_TblProduct.BondAmtMax = TblProductVersionRefill!BondAmtMax,
DEV_dbo_TblProduct.BondEffectiveDate =
TblProductVersionRefill!BondEffectiveDate, DEV_dbo_TblProduct.BondAmtStd =
TblProductVersionRefill!BondAmtStd, DEV_dbo_TblProduct.MinCreditScore =
TblProductVersionRefill!MinCreditScore, DEV_dbo_TblProduct.CancelDays =
TblProductVersionRefill.CancelDays, DEV_dbo_TblProduct.Description =
TblProductVersionRefill.NewBusinessFormId, DEV_dbo_TblProduct.FormId =
TblProductVersionRefill.NewBusinessFormId,
DEV_dbo_TblProduct.BondExpirationDate =
TblProductVersionRefill!BondExpirationDate, DEV_dbo_TblProduct.BondTermMonths
= TblProductVersionRefill!BondTermMonths, DEV_dbo_TblProduct.RiskType =
TblProductVersionRefill!RiskType, DEV_dbo_TblProduct.RateType =
TblProductVersionRefill!RateType, DEV_dbo_TblProduct.Attachments =
TblProductVersionRefill.Attachments, DEV_dbo_TblProduct.RenewalMethod =
TblProductVersionRefill!RenewalMethod, DEV_dbo_TblProduct.Countersignatures =
TblProductVersionRefill.Countersignatures, DEV_dbo_TblProduct.BondAmtMin =
TblProductVersionRefill!BondAmtMin, DEV_dbo_TblProduct.SpecialInstructions =
TblProductVersionRefill!SpecialInstructions, DEV_dbo_TblProduct.EAndOFlag =
TblProductVersionRefill.EAndOFlag
WHERE
(((DEV_dbo_TblProduct.RateCode)<>[TblProductVersionRefill].[RateCode])) OR
(((DEV_dbo_TblProduct.BondAmtMax)<>[TblProductVersionRefill].[BondAmtMax])
AND
((DEV_dbo_TblProduct.Description)<>[TblProductVersionRefill].[Description])
AND
((DEV_dbo_TblProduct.BondTermMonths)<>[TblProductVersionRefill].[BondTermMonths])
AND ((DEV_dbo_TblProduct.RateType)<>[TblProductVersionRefill]![RateType]) AND
((DEV_dbo_TblProduct.Attachments)=IIf(Nz([TblProductVersionRefill]![Attachments],0)=-1,"Y","N")
And (DEV_dbo_TblProduct.Attachments)<>"[tblProductVersion].[Attachments]")
AND
((DEV_dbo_TblProduct.Countersignatures)=IIf(Nz([TblProductVersionRefill]![Countersignatures],0)=-1,"Y","N")
And
(DEV_dbo_TblProduct.Countersignatures)<>"[TblProductVersionRefill].[Countersignatures]")
AND
((DEV_dbo_TblProduct.SpecialInstructions)<>[TblProductVersionRefill].[SpecialInstructions])
AND
((DEV_dbo_TblProduct.EAndOFlag)=IIf(Nz([TblProductVersionRefill]![EAndOFlag],0)=-1,"Y","N")
And (DEV_dbo_TblProduct.EAndOFlag)<>"[TblProductVersionRefill].[EAndOFlag]"))
OR
(((DEV_dbo_TblProduct.BondEffectiveDate)<>[TblProductVersionRefill].[BondEffectiveDate]))
OR (((DEV_dbo_TblProduct.BondAmtStd)<>[TblProductVersionRefill]![BondAmtStd])
AND
((DEV_dbo_TblProduct.BondExpirationDate)<>[TblProductVersionRefill].[BondExpirationDate])
AND ((DEV_dbo_TblProduct.RiskType)<>[TblProductVersionRefill].[RiskType]) AND
((DEV_dbo_TblProduct.RenewalMethod)<>[TblProductVersionRefill].[RenewalMethod]))
OR
(((DEV_dbo_TblProduct.MinCreditScore)<>[TblProductVersionRefill].[MinCreditScore])
AND
((DEV_dbo_TblProduct.BondAmtMin)<>[TblProductVersionRefill].[BondAmtMin])) OR
(((DEV_dbo_TblProduct.CancelDays)<>[TblProductVersionRefill].[CancelDays]))
OR
(((DEV_dbo_TblProduct.FormId)<>[TblProductVersionRefill].[NewBusinessFormId]));
 

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

Top