Inconsistant query results

C

Claire

I'm at a loss for this one...

I was working on designing new queries for a database that is on going, so I
saved it as something else and played around in that (we'll call it version
2) while maintaining the first version (version 1). Yesterday there was much
joy as I got the nested queries to all work, and then programmed a form to
run them with a form text box as the parameter. After enabling the content
again (which was a long discovery in why the VBA was not working), it appears
that everything is okay, and copied over. Except for one query, upon which
all of the later queries are based. The funny thing is that it runs in
version 2, but not in version 1. I have copied and pasted the SQL directly
from version 1 to version 2, and the other way, and still it will work in
version 2, but not version 1. My guess is that there's something basic I'm
missing.

Here's the SQL:
SELECT A.*, B.*
FROM tblPayroll_History AS A INNER JOIN tblETO_Levels AS B ON
(A.Employee_Type = B.Employee_Type) AND (A.ETO_Level = B.ETO_Level)
WHERE (((Exists (select * from tblPayroll_History as C where
C.Employee_ID=A.Employee_ID and C.Record_ID > A.Record_ID))=False));

In version 1 it asks for a parameter "C.Record_ID" and "A.Record_ID", but if
I leave those parameters blank and OK through them, it brings up the correct
records.

In version 2 it does not ask for any parameters.

Does anyone have any thoughts on this perplexing problem?

Many thanks,
Claire
 
C

Claire

Never mind. I figured it out. The automated Primary key had the different
name in the other database. I forgot about that one.
 

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