Easy Update question

G

Guest

I have 5 tables (source) and one target table. What I want to do is if there
is an entry into any of the fields that I have in my grid I want that record
to be updated into my target table when the query is ran. Here is an example
of an expression I am using under each field.

1. <>[dbo_tblProduct].[StateAbbr]

I also put an "Is Not Null" under my source table and target table Product ID.

Does this seem to look ok. I keep getting all of the records in the source
table. What am I doing wrong?
 
G

Guest

SELECT DEV_dbo_TblProduct.ProductId, dbo_TblProduct.ProductId,
dbo_TblProduct.StateAbbr, dbo_tblObligationType.ProductLine,
dbo_tblObligationType.BondType, dbo_tblObligationType.CategoryID,
dbo_TblProductVersion.NewBusinessFormID, dbo_TblProductVersion.RateType,
dbo_TblProduct.ObligeeId, dbo_TblProductVersion.RenewalMethod,
dbo_TblProductVersion.BondEffectiveDate,
dbo_TblProductVersion.BondExpirationDate,
dbo_TblProductVersion.BondTermMonths, dbo_TblProductVersion.BondAmtStd,
dbo_TblProductVersion.BondAmtMin, dbo_TblProductVersion.BondAmtMax,
dbo_TblProductVersion.CancelDays, dbo_TblProduct.[Available Online],
dbo_tblSaaDocument.ClassCode, dbo_TblProductVersion.RateCode,
dbo_TblProductVersion.SpecialInstructions,
dbo_TblProduct.BondObligationDescription, dbo_TblProductVersion.RiskType,
dbo_TblProductVersion.MinCreditScore, dbo_TblProduct.ObligationTypeID,
IIf(dbo_tblProductversion.Attachments=True,"Y","N") AS Attachments,
IIf(dbo_tblProductversion.EAndOFlag=-1,"Y","N") AS EAndOFlag,
IIf(dbo_TblProductVersion.Countersignatures=-1,"Y","N") AS Countersignatures
FROM dbo_tblSaaDocument INNER JOIN (dbo_tblObligationType INNER JOIN
(dbo_TblProductVersion INNER JOIN (DEV_dbo_TblProduct RIGHT JOIN
dbo_TblProduct ON DEV_dbo_TblProduct.ProductId = dbo_TblProduct.ProductId) ON
dbo_TblProductVersion.ProductId = dbo_TblProduct.ProductId) ON
dbo_tblObligationType.ObligationTypeID = dbo_TblProduct.ObligationTypeID) ON
dbo_tblSaaDocument.SaaDocumentID = dbo_tblObligationType.SaaDocumentID
WHERE (((dbo_TblProduct.ProductId) Is Not Null)) OR
(((DEV_dbo_TblProduct.ProductId) Is Not Null)) OR
(((dbo_TblProduct.StateAbbr)<>[dbo_tblProduct].[StateAbbr]) AND
((dbo_TblProductVersion.BondAmtMin)<>[dbo_TblProductVersion].[BondAmtMin]))
OR
(((dbo_tblObligationType.ProductLine)<>[dbo_tblObligationType].[ProductLine])
AND
((dbo_TblProductVersion.BondAmtStd)<>[dbo_TblProductVersion].[BondAmtStd])
AND
((dbo_TblProductVersion.BondAmtMax)<>[dbo_TblProductVersion].[BondAmtmax]))
OR (((dbo_tblObligationType.BondType)<>[dbo_tblObligationType].[BondType])
AND
((dbo_TblProductVersion.BondTermMonths)<>[dbo_TblProductVersion].[BondTermMonths])
AND
((dbo_TblProductVersion.CancelDays)<>[dbo_TblProductVersion].[CancelDays])
AND ((dbo_TblProduct.ObligationTypeID)<>[dbo_TblProduct].[ObligationTypeID]))
OR
(((dbo_tblObligationType.CategoryID)<>[dbo_tblObligationType].[CategoryID])
AND
((dbo_TblProductVersion.BondExpirationDate)<>[dbo_TblProductVersion].[BondExpirationDate])
AND ((dbo_TblProduct.[Available Online])<>[dbo_TblProduct].[Available
Online]) AND
((dbo_TblProductVersion.MinCreditScore)<>[dbo_TblProductVersion].[MinCreditScore]))
OR
(((dbo_TblProductVersion.NewBusinessFormID)<>[dbo_TblProductVersion].[NewBusinessFormID])
AND
((dbo_TblProductVersion.BondEffectiveDate)<>[dbo_TblProductVersion].[BondEffectiveDate])
AND ((dbo_tblSaaDocument.ClassCode)<>[dbo_tblSaaDocument].[ClassCode]) AND
((dbo_TblProductVersion.RiskType)<>[dbo_TblProductVersion].[RiskType])) OR
(((dbo_TblProductVersion.RateType)<>[dbo_TblProductVersion].[RateType]) AND
((dbo_TblProductVersion.RenewalMethod)<>[dbo_TblProductVersion].[RenewalMethod])
AND ((dbo_TblProductVersion.RateCode)<>[dbo_TblProductVersion].[RateCode])
AND
((dbo_TblProduct.BondObligationDescription)<>[dbo_TblProduct].[BondObligationDescription]))
OR (((dbo_TblProduct.ObligeeId)<>[dbo_TblProduct].[ObligeeId]) AND
((dbo_TblProductVersion.SpecialInstructions)<>[dbo_TblProductVersion].[SpecialInstructions]))
WITH OWNERACCESS OPTION;


troy said:
I have 5 tables (source) and one target table. What I want to do is if there
is an entry into any of the fields that I have in my grid I want that record
to be updated into my target table when the query is ran. Here is an example
of an expression I am using under each field.

1. <>[dbo_tblProduct].[StateAbbr]

I also put an "Is Not Null" under my source table and target table Product ID.

Does this seem to look ok. I keep getting all of the records in the source
table. What am I doing wrong?
 

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