Problem with a query comparing multiple feilds

G

Guest

Here's what I'm trying to do.

TblFidNCS and two feilds, AssetID and FAssetID. These fields need to be
compared to the AssetID feild in TblBkData. We need to see if the feild in
TblBkData matches either AssetID of FAssetID in TblFidNCS.

If we have a match for the ID, but we do not have a match for the Ex field I
need the result to come up in a query.

Here's the bad code I've written below that will hopefully give you an idea
of my problem:

SELECT TblBkData.AssetID, TblBkData.AType, TblBkData.Ex, TblBkData.Rec,
TblBkData.Pay, TblBkData.Tax, TblBkData.GRate, TblBkData.Ctry,
TblBkData.Curr, TblBkData.Src, TblBkData.AnDt, TblBkData.AmDt
FROM TblBkData, TblFidNCS
WHERE (((TblBkData.AssetID)=[TblFidNCS].[FAssetID]) AND
((TblBkData.Ex)<>[TblFidNCS].[Ex])) OR
(((TblBkData.AssetID)=[TblFidNCS].[AssetID]) AND
((TblBkData.Ex)<>[TblFidNCS].[Ex]));

Here's a little visual of what I'm shooting for to report on in the query

TblFidNCS TblBkData
AssetID FAssetID Ex AssetID Ex
123456789 987654321 6/5 123456789 7/10
 
M

Michel Walsh

Hi,



Try a WHERE clause like:

WHERE TblBkData.AssetID IN( TblFidNCS.AssetID , TblFidNCS.FAssetID )



Hoping it may help,
Vanderghast, Access MVP
 

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

Similar Threads


Top