Why do I get this prompt?

D

Dorian

When running the below query I get prompted for Query1.TicketID
I then have to enter something for it to run. If I don't, it returns an
empty result set. If I do, it returns the correct results (for every TicketID)
Why the prompt?

SELECT A.TicketID, A.TeamID, A.AssignDate
FROM tblAssign AS A
WHERE A.AssignDate = (SELECT MAX(A2.AssignDate) FROM tblAssign As A2 WHERE
A2.TicketID = A.TicketID);
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
M

Michel Walsh

That may be due to a format or other stuff related to your query, as
maintained and remembered by Access, but not present in the SQL statement
itself. Cut and paste the statement into a brand new query just to be sure.


Vanderghast, Access MVP
 
D

Dorian

If I change
WHERE A2.TicketID = A.TicketID
to
WHERE tblAssign.TicketID = A.TicketID
the prompt changes from
Query1.TicketID to tblAssign.TicketID
so it has something to do with the last WHERE clause.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
M

Michel Walsh

Then it is either a typo error, either autocorrect also change the 'hidden'
property implying query1,ticketID to tblAssign.TicketID.

Have you TRIED to cut and paste the SQL statement in a brand new query, or
not?


Vanderghast, Access MVP
 

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