Solved

Access Query

Posted on 2007-04-11
2
188 Views
Last Modified: 2010-03-20
I have a 2 tables that are listed below

Table Name is Current_DRP_Files and the fields are listed below
Dest Loc      
Dest Description      
Item Code      
UPC      
Description      
Active/Inactive      
Code Eff Date      
Code End Date      
Source Loc      
Source Loc Description      
Override Recv Days      
Recv Weeks
Product Group      
BDC

The other Table name is MLS_Data and has the following fields
Dest_Ctry_cd
Dest_Not_used
Dest_LMS_id
Dest_Loc_type
Product_Code
Source_Ctry_cd
Source_not_used
Source_id
Loc_type_cd
ORD
ORW

I want the result to have the following fields.
Current_DRP_Files.UPC,
Current_DRP_Files.[Item Code],
Current_DRP_Files.Description,
Current_DRP_Files.BDC,
Current_DRP_Files.[Product Group],
Current_DRP_Files.[Source Loc],
Current_DRP_Files.[Source Loc Description],
Current_DRP_Files.[Dest Loc],
Current_DRP_Files.[Dest Description],
Current_DRP_Files.[Override Recv Days],
Current_DRP_Files.[Recv Weeks],
MLS_Data.ORD,
MLS_Data.ORW

The comman fields are the following
Current_DRP_Files.[Item Code] = MLS_Data.Product_Code
Current_DRP_Files.[Source Loc] = MLS_Data.Source_Id
(Current_DRP_Files.[Dest Loc] = MLS_Data.Dest_LMS_Id

I want all records where the
Current_DRP_Files.[Override Recv Days] <> MLS_Data.ORD
or
Current_DRP_Files.[Recv Weeks] <> MLS_Data.ORW
0
Comment
Question by:awehme
  • 2
2 Comments
 
LVL 5

Expert Comment

by:sphillips1971
Comment Utility
SELECT Current_DRP_Files.UPC,
Current_DRP_Files.[Item Code],
Current_DRP_Files.Description,
Current_DRP_Files.BDC,
Current_DRP_Files.[Product Group],
Current_DRP_Files.[Source Loc],
Current_DRP_Files.[Source Loc Description],
Current_DRP_Files.[Dest Loc],
Current_DRP_Files.[Dest Description],
Current_DRP_Files.[Override Recv Days],
Current_DRP_Files.[Recv Weeks],
MLS_Data.ORD,
MLS_Data.ORW
FROM Current_DRP_Files INNER JOIN MLS_Data ON
Current_DRP_Files.[Item Code] = MLS_Data.Product_Code AND
Current_DRP_Files.[Source Loc] = MLS_Data.Source_Id AND
(Current_DRP_Files.[Dest Loc] = MLS_Data.Dest_LMS_Id
WHERE
Current_DRP_Files.[Override Recv Days] <> MLS_Data.ORD
OR Current_DRP_Files.[Recv Weeks] <> MLS_Data.ORW
0
 
LVL 5

Accepted Solution

by:
sphillips1971 earned 500 total points
Comment Utility
Forgot to take out one of your parenthesis:

SELECT Current_DRP_Files.UPC,
Current_DRP_Files.[Item Code],
Current_DRP_Files.Description,
Current_DRP_Files.BDC,
Current_DRP_Files.[Product Group],
Current_DRP_Files.[Source Loc],
Current_DRP_Files.[Source Loc Description],
Current_DRP_Files.[Dest Loc],
Current_DRP_Files.[Dest Description],
Current_DRP_Files.[Override Recv Days],
Current_DRP_Files.[Recv Weeks],
MLS_Data.ORD,
MLS_Data.ORW
FROM Current_DRP_Files INNER JOIN MLS_Data ON
Current_DRP_Files.[Item Code] = MLS_Data.Product_Code AND
Current_DRP_Files.[Source Loc] = MLS_Data.Source_Id AND
Current_DRP_Files.[Dest Loc] = MLS_Data.Dest_LMS_Id
WHERE
Current_DRP_Files.[Override Recv Days] <> MLS_Data.ORD
OR Current_DRP_Files.[Recv Weeks] <> MLS_Data.ORW
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now