INNER JOIN - Need help

J

JString

Greetings.

I'm having a little trouble with my queries and will be very grateful if
anyone can help. The problem I'm having is very strange and is difficult to
describe but I will do my best.

First of all, let me explain what I need my database to do. I have a
collection of csv log files that need to be imported into the db, which will
then manipulate the data in various ways. All of these csv files are uniform
and contain the same kind of data, however there are two distinct types of
records contained in them, which are marked by a boolean value. These two
types of records need to be compaired against one another in a way that
explores every possible combination.

Because all of these records have the same structure and come from the same
source, I thought it would be best to import them all into the same table.
Next, I developed two simple SELECT queries which pull each record of each
type so that each query represents a collection of records of a single type
(I'll call them Query1 and Query2 to keep things simple). Then, to run the
necessary comparisons, I developed a third, INNER JOIN query based on Query1
and Query2. For the most part this third query works as it was intended,
however there always seems to be at least a few records which are returning
some erroneous results.

Now these results I'm getting don't seem to be related to the existence of
Null values or anything like that, but in these cases I am getting completely
wrong values as if Access is just too confused to perform the calculations on
the right data.

Now I know that at this point there could be many, many possible
explanations, but before I go into all the details of my code and what not I
think that I have more info that could really help to clear this up. After
hours of debugging and assuming the mistake(s) were in my code without any
progress, I decided to test the queries. The first step I took was to create
two new tables to store the different record types and I developed another
simple INNER JOIN query based on those two tables rather than Query1 and
Query2. This new query had exactly the same design as its predecessor and
performed the exact same calculations on the data, but this time there were
no erroneous values.

So it seems that something isn't right by using two queries as the source
for the INNER JOIN query. I could modify the overall design of the db to get
around this problem but it would be very difficult to do so. If anyone can
explain why this happens or how to do it correctly I would very much
appreciate it.
 
K

KARL DEWEY

It is hard to know without seeing your three queries and sample data.
Why not post the data for perusal.
 

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

Top