Solved

Access Query

Posted on 2007-04-11
2
227 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 5

Expert Comment

by:sphillips1971
ID: 18892977
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
ID: 18892992
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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

636 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