I've been fighting with this for weeks now

G

Guest

Here's the story...Two tables...One has an Asset ID #..The other has two
Asset ID #'s..One named AssetID, the other named FAssetID. I want to run the
following query to see if there is a match to the Asset ID # in TblBkData
against the AssetID and FAssetID in TblFidNCSData. This query does not work!

This is killing me. I apolgize in advance for the complexity of the query.
This was a long time in the making until someone jacked up the requirements
on me. Your help on this is greatly appreciated!!!

SELECT TblBkData.Ex, TblFidNCS.CAID, TblBkData.AssetID, TblFidNCS.SecNm,
TblBkData.AType, TblBkData.Rec, TblBkData.Pay, TblBkData.Tax,
TblBkData.GRate, TblBkData.Ctry, TblBkData.Curr, TblFidNCS.Type,
TblBkData.Src, TblSrc.ScrNum, TblFidNCS.AssetID, TblFidNCS.FAssetID,
TblBkData.AnDt, TblBkData.AmDt

FROM TblSrc INNER JOIN (TblBkData INNER JOIN TblFidNCS ON TblBkData.AssetID
= TblFidNCS.AssetID) ON TblSrc.Src = TblBkData.Src

WHERE (((TblBkData.Ex)=[TblFidNCS].[Ex] And
(TblBkData.Ex)=[Forms]![FrmDateD1K]![DtSrcDtD1K]) AND ((TblFidNCS.SecNm)
Between "1*" And "K*") AND ((TblFidNCS.Type)="D") AND
((TblFidNCS.AssetID)=[TblBkData].[AssetID])) OR
(((TblBkData.Ex)=[TblFidNCS].[Ex] And
(TblBkData.Ex)=[Forms]![FrmDateD1K]![DtSrcDtD1K]) AND ((TblFidNCS.SecNm)
Between "1*" And "K*") AND ((TblFidNCS.Type)="D") AND
((TblFidNCS.FAssetID)=[TblBkData].[AssetID]))

ORDER BY TblFidNCS.SecNm;
 
K

Ken Snell \(MVP\)

Perhaps this:

SELECT TblBkData.Ex, TblFidNCS.CAID, TblBkData.AssetID, TblFidNCS.SecNm,
TblBkData.AType, TblBkData.Rec, TblBkData.Pay, TblBkData.Tax,
TblBkData.GRate, TblBkData.Ctry, TblBkData.Curr, TblFidNCS.Type,
TblBkData.Src, TblSrc.ScrNum, TblFidNCS.AssetID, TblFidNCS.FAssetID,
TblBkData.AnDt, TblBkData.AmDt
FROM TblBkData, TblFidNCSData
WHERE TblBkData.AssetID=TblFidNCSData.AssetID
OR TblBkData.AssetID=TblFidNCSData.FAssetID;
 
J

John Vinson

Here's the story...Two tables...One has an Asset ID #..The other has two
Asset ID #'s..One named AssetID, the other named FAssetID. I want to run the
following query to see if there is a match to the Asset ID # in TblBkData
against the AssetID and FAssetID in TblFidNCSData. This query does not work!

Could you help translate the English language construct "against the
AssetID and FAssetID" into Boolean logic?

In other words, what qualifies a record in TblFidNCSData as a "hit" -
must BOTH AssetID and FAssetID match? or is it a hit if either one
matches?

John W. Vinson[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