Troy-
That tells me that Query 2 does, in fact, return more than one row per
combination of Job and Process. You'll get the Cartesian Product when that is
the case - or more rows in the final query than there are in either table.
John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Lahaina, HI)
-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Troy Sherven
Sent: Wednesday, February 01, 2012 12:50 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Access 2010 Join question
I'm writing a query in Access 2010, and am having issues with a join.
It seems like it should be simple, but I'm struggling. I'm joining 2
queries to create a new query. My goal is to bring in the "Helper QTY"
data (query 2) into the "Scheduled routings" data (query 1). Here are
my "source" queries:
Query 1 (Scheduled_Routings)
Job_number Process_number
1234 1
1234 1
1234 2
Query 2 (Helper_qty)
Job_number Process_number Helper_QTY
1234 1
2
1234 2
0
Query 1 can have multiple records for each job number and process
number. Query 2 has only 1 record for each process number within the
job. I'm joining the queries by Job_number and Process_number, and am
using a "Left Join". Here's the SQL: LEFT JOIN Helper_qty ON
(Scheduled_Routings.Work_Order_ID = Helper_qty.Jobno) AND
(Scheduled_Routings.Processno = Helper_qty.processno)
I get 400 records when I run query 1 alone. After I join query 2, I get
about 600 records. There are 46 records returned when I run query 2
alone. What am I doing wrong?
Thanks,
Troy Sherven
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
Rabu, 01 Februari 2012
RE: [MS_AccessPros] Access 2010 Join question
__._,_.___
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar