Hi,
I have a query with 3 tables in it. It contains numerous fields, mainly from Table1, with a sprinkling from Table2 and Table3. The query returns 5 records.
The records are all the same apart from the Date field, which contains different values for each of the records. The Date field is in Table3.
I want to return the record with the earliest date, but not sure how too.
I think I need to use a GROUP BY but I dont want to group on all the different fields.
If I use a MIN in the WHERE clause, around the Date field, I get a:
"An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list..."
Any help would be appreciated!
I have a query with 3 tables in it. It contains numerous fields, mainly from Table1, with a sprinkling from Table2 and Table3. The query returns 5 records.
The records are all the same apart from the Date field, which contains different values for each of the records. The Date field is in Table3.
I want to return the record with the earliest date, but not sure how too.
I think I need to use a GROUP BY but I dont want to group on all the different fields.
If I use a MIN in the WHERE clause, around the Date field, I get a:
"An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list..."
Any help would be appreciated!