Solved

Access Query

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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