Query gives incorrect count of records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I bringing info from 2 tables (194 total records), into 1 query the
total is 47,000 plus..Both tables have the same column headers, with the only
difference being one is from 2004-2005 and the other is from 2005-2006
 
I have tried to use SELECT [Report Table04].[Week#] AS [Report
Table04_Week#], [Report Table04].AbsenceDate AS [Report Table04_AbsenceDate],
FROM [Report Table04] Join [Report Table04].[Week#] AS [Report
Table04_Week#],
 
SELECT [Report Table04].[Week#] AS [Report Table04_Week#], [Report
Table04].AbsenceDate AS [Report Table04_AbsenceDate],
FROM [Report Table04],
JOIN
[Report Table05].[Week#] AS [Report Table05_Week#], [Report
Table05].AbsenceDate AS [Report Table05_AbsenceDate],
FROM [Report Table05],
 
You haven't given a field (or fields) to join on, so you've getting a
cartesian product: each row in [Report Table04] is being joined with every
row in [Report Table05].

You need to join them on whatever key (keys) is (are) in common between
them.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bruce said:
SELECT [Report Table04].[Week#] AS [Report Table04_Week#], [Report
Table04].AbsenceDate AS [Report Table04_AbsenceDate],
FROM [Report Table04],
JOIN
[Report Table05].[Week#] AS [Report Table05_Week#], [Report
Table05].AbsenceDate AS [Report Table05_AbsenceDate],
FROM [Report Table05],


Douglas J. Steele said:
What's the SQL for your query?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top