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
Solved

Access Query

Posted on 2007-04-11
2
212 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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 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