Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

Problem with a query comparing multiple feilds

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RobertM - 10 Jul 2006 22:41 GMT
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
Michel Walsh - 10 Jul 2006 22:55 GMT
Hi,

Try a WHERE clause like:

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

Hoping it may help,
Vanderghast, Access MVP

> Here's what I'm trying to do.
>
[quoted text clipped - 24 lines]
> AssetID            FAssetID            Ex            AssetID            Ex
> 123456789       987654321        6/5          123456789        7/10
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.