Query Problem - Missing Records

S

silva

I have a query with no filters or conditions, yet it only shows about 100-150
of the 1000-2000 records it should show. What causes this, and how can I fix
it?

Also, I noticed that a table has over 800 empty records. I tried to do a
delete query but it won't display any records. I tried adding conditions so
that it would find them and it displayed more, but still not all. Should I
just go into the table and manually delete them, or is there a way to fix the
delete query?
 
J

Jerry Whittle

Show us the SQL. Open the query in design view. Next go to View, SQL View
and copy and past it here. Information on primary keys and relationships
would be a nice touch too.

Do this for the delete query also.
 
S

silva

I realized the problem... The query pulls data from across three tables, and
only displays records where there is associated data from all three. One
table has our guest information, one has data relating to comment cards and
such they've sent in, and the third has info on passes sent to them. It's not
showing records where there were no passs sent. Here's the SQL (there's a lot
to read):

SELECT Guest_Info_Table.guest_full_name, Guest_Info_Table.city,
Guest_Info_Table.state, Guest_Info_Table.zip_code,
Guest_Info_Table.email_address, Guest_Contact_Table.contact_method,
Guest_Contact_Table.theatre, Guest_Contact_Table.visit_date,
Guest_Contact_Table.movie, Guest_Contact_Table.showtime,
Guest_Contact_Table.first_time, Guest_Contact_Table.frequent,
Guest_Contact_Table.friendliness, Guest_Contact_Table.cleanliness,
Guest_Contact_Table.promptness, Guest_Contact_Table.quality,
Guest_Contact_Table.comment_on, Guest_Contact_Table.contact_reason,
Guest_Contact_Table.comments, Guest_Contact_Table.experience,
Guest_Contact_Table.emp_contacted, Guest_Contact_Table.receive_date,
Guest_Contact_Table.was_contacted, Guest_Contact_Table.respond_date,
Guest_Contact_Table.responder, Guest_Contact_Table.resolution,
Guest_Contact_Table.passes_sent, Pass_Info_Table.pass_number,
Pass_Info_Table.exp_date, Pass_Info_Table.mail_date,
Guest_Contact_Table.donation, Guest_Contact_Table.organization,
Guest_Contact_Table.donation_date, Guest_Contact_Table.pass_locations
FROM Guest_Info_Table INNER JOIN (Guest_Contact_Table INNER JOIN
Pass_Info_Table ON
Guest_Contact_Table.contact_autonumber=Pass_Info_Table.event_number) ON
Guest_Info_Table.guest_id_number=Guest_Contact_Table.guest_id;
 
J

Jerry Whittle

Try turning the INNER JOIN to LEFT JOIN between the Guest_Contact_Table and
the other two.
 
S

silva

Ah ha! Excellent! I guess this was one of those little things that was either
overlooked, or I did in a wizard and the option wasn't available. This was
originally created when there weren't any real records created, only test
records. It works perfectly now, thank you. :)
 

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