Thank you again for your help -
Just to let you know - this database is not set up
properly. The employee name field is not separated into 2
fields. The person who set it up, combined last & first
name in the same field (example: Smith, John) - When I
get the chance, I am going to separate the one field into
two. That's another problem.
Anyway, below are the tables:
tblTrainingGrid
SOPNumber
TrainingType
EmployeeName
DocumentationDate
tblSOP
SOPNumber
SOPName
SOPType
tblTrainingType
TrainingType
tblEmployee
EmployeeName
EmployeeNumber
DateOfHire
TerminationDate
This may be redundant, but this is how my boss wants to
validate the records in the table. Take the
tblTrainingGrid and create a query based on the that
table using all 4 fields. Compare total amount of
records in the table vs. the query. Then I recently
created an "Unmatched Query" comparing the table and the
query. If there were any unmatched records before, the
girl who created this DB used to print out the table and
the query data and manually check the records. I created
a report based on the unmatched query and the user would
be able to click a command button to see WHICH records
were unmatched.
I want to revamp this DB went I get the chance. In the
meantime, I have to work with this. Another problem with
this DB: Instead of creating one DB with all the
different departments who use this DB. She created 4
databases for each department. I will attempt to combine
this into one and create a department table without
(hopefully) jeopardizing the integrity of the data - Any
suggestions?
The reason I mention that is because I created the same
unmatched query for the other databases and every thing
worked out fine. This DB has 57 unmatched records and my
query is not finding them.
Thank you so much for your help.
-----Original Message-----
You refer to "a table", but your query is using two
tables as the source for
the data. So, I don't know "which" table you mean.
I think, after reading your reply, that you are using the
wrong query for what you want? It sounds as if you're
comparing two tables and want to know
if they "match"?
(Note: one should not be using two separate tables to
maintain the same set of data -- it leads to all types of
problems -- such as what you're now seeing -- if they are
not meticulously kept exactly the same.)
Let's back up and start from the beginning so that I can
understand exactly which tables you have, which data are
in each table, what the fields are in each table, and
what you want your query to tell you. That should enable
us to point you to a solution.
Ken Snell
MS ACCESS MVP>
message Thank you for your help - What I don't understand is that
the table has 4 fields - ("SOPNUmber" - "TrainingType" -
"Employee" and "DocumentationDate") and the query I'm
comparing the table to is based on the same 4 fields in
the table - This is something that was set up before I
starting working on it and my boss just wants (for audit
purposes) to compare the table in which we use for data
entry and then take the same table and all the same
fields and create a query. Then check the total number
of records in the table and in the query and they should
match (example: Table: 2000 records & query 2000 records)
My question is: If I'm creating a carbon copy (the query)
of the table, why do I have less records in the query?
Sorry about this mess.
-----Original Message-----
I am confused by your concern regarding the query
returning fewer records than are in the table. You don't
say which table has 1788 records, so I cannot speak with
specificity about the tables.
However, in general, your query has a WHERE clause in it:
WHERE ((([SOP Training Information].DocumentationDate) Is
Null))
By definition, using a WHERE clause means that the query
most likely will return fewer records than are in the
source table. You're excluding records by using a WHERE
clause.
So, can you provide more explanations about why your
results puzzle you?
Ken Snell
MS ACCESS MVP>
message
I created a "Find Unmatched Query"
I am comparing a table to a query - Access is not finding
ANY unmatched records. I know that there are NO
duplicates in the table and there are NO
empty fields. What else should I look for? I can't
figure out why the query is not find these unmatched
records.
Below is the SQL view of the query.
SELECT [Training Grid].SOPNumber, [Training
Grid].TrainingType, [Training Grid].EmployeeName,
[Training Grid].DocumentationDate FROM [Training Grid]
LEFT JOIN [SOP Training Information] ON [Training
Grid].DocumentationDate=[SOP Training
Information].DocumentationDate WHERE ((([SOP Training
Information].DocumentationDate) Is Null));
I'm comparing a table and a query. They both have the
same fields - The table has 1788 records and the
query has 1731 records. If I'm comparing the same data,
why would I have more records in the table and less in the
query? Obviously the query is not recognizing some
records in the table. But how do I find out which records
if the "Unmatched Query" is not finding them? Sorry, I'm
confused.
Thank you for your time, Natalia