Issues with Update query PLEASE HELP!

G

Guest

I built and expression from a table field to convert the Y/N datatype (-1, 0)
to a Y or N. I did this because the target table is a Text datatype with Y or
N put in manually.

I need to update my expression field to a update query, and the update
query wont allow me to add the correct table from where I built the
expression. Because of this I can not do an update query. I have done and
used the exact query on a select and Append query but cant complete the
Update Qry. I get a syntax error only when I try to add the table to my
query. If I dont add the table it works fine!

Here is my expression and it WORKS FINE. PLEASE PROVIDE ANY OTHER
INFOMATION YOU MAY HAVE EXCEPT TO TRY "THIS TYPE OF EXPRESSION" I have tried
everything and more from other members ideas and nothing seems to work. I do
however want to thank everyone that is trying to help.

This is so easy I must be overlooking something? Please help it has been
to long time spent on this. I have posted here before but nothing seems to be
working. Please help! IIf(dbo_tblProductversion.Attachments=-1,"Y","N")
 
G

Guest

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

Guest

I thought you were having trouble with an update query but what you posted is
select query.
Post your update query, the one where you say that "...the update
query wont allow me to add the correct table..."

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


KARL DEWEY said:
Post your SQL.
 

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