Simple Query question?

G

Guest

I have two tables:
Source Table where data (FIELDS) are changed
Target Table where changed fields is going by the means of update query

Query is ran to see all records that have been changed on a weekly basis.
The correct product numbers and the correct amount of records show when query
has been ran. The problem is that the data showing is from the target table
and not the source table. How can this happen? The query reads the correct
records where the fields have been changed but it shows the data from the
target table and not the table were the data was changed. I HAVE TRIED
EVERYTHING PLEASE HELP!
 
G

Guest

I just noticed something. I started my query from scratch and I found out the
following...

1. when I add all my fields and connect the two tbls it works in select qry
2. when I select UPDATE query it also works
3. When I change the table from my Source table to my Target table (see
below) that is when I get the data from my target table. No criteria set etc.
Here is what it looks like

Field: Field that will be receiving new data
Table: The Target table from field above
Update to: [Source table]![source field]
No criteria set at this point
 
G

Guest

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

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