SELECT Table1.Field1,
(SELECT DISTINCT Table2.Field2
FROM Table2
WHERE Table2.FieldID = Table1.FieldID AND
Table1.Field3 >= #1/1/200# AND
Table1.Field3 < #7/7/2003# AND
Table1.Field4 > 40)
FROM Table1
WHERE Table2.FieldID = Table1.FieldID
ORDER BY Table1.Field1 DESC
Here's my query with representations for the tables and fields to, hopefully, make this more readable. Field3 is a date field and Field4 is an integer field, so I'm fairly certain that the issue is not data related, but I can't get this query to process, even though I've seen similar queries work before. I would just use a join on these two tables but I don't think you can do so with a distinct query and get the query to really retrieve distinct data. If I'm wrong on that, please let me know.
Otherwise, my goal is to retrieve the distinct data from Field2 of Table2 that falls within the listed criteria and retrieve the data from Field1, Table1 that corresponds to the data retrieved from Table2, in descending order.
(SELECT DISTINCT Table2.Field2
FROM Table2
WHERE Table2.FieldID = Table1.FieldID AND
Table1.Field3 >= #1/1/200# AND
Table1.Field3 < #7/7/2003# AND
Table1.Field4 > 40)
FROM Table1
WHERE Table2.FieldID = Table1.FieldID
ORDER BY Table1.Field1 DESC
Here's my query with representations for the tables and fields to, hopefully, make this more readable. Field3 is a date field and Field4 is an integer field, so I'm fairly certain that the issue is not data related, but I can't get this query to process, even though I've seen similar queries work before. I would just use a join on these two tables but I don't think you can do so with a distinct query and get the query to really retrieve distinct data. If I'm wrong on that, please let me know.
Otherwise, my goal is to retrieve the distinct data from Field2 of Table2 that falls within the listed criteria and retrieve the data from Field1, Table1 that corresponds to the data retrieved from Table2, in descending order.