Below is the SQL statement.
I am trying to group by the TICKET_NO and grab the MAX of the MAX_DATE field (which is the STATUS_DATE AND STATUS_TIME combined)
When I run the query, it keeps returning: "You tried to execute a query that does not include the specified expression 'CREATE_DATE' as part of an aggregate function."
Any help is much appreciated.
I am trying to group by the TICKET_NO and grab the MAX of the MAX_DATE field (which is the STATUS_DATE AND STATUS_TIME combined)
When I run the query, it keeps returning: "You tried to execute a query that does not include the specified expression 'CREATE_DATE' as part of an aggregate function."
Any help is much appreciated.
Code:
SELECT tblIncident.TICKET_NO, tblIncident.CREATE_DATE, tblStatusHistory.STATUS_DATE, tblStatusHistory.STATUS_TIME, Max([STATUS_DATE] & " " & [STATUS_TIME]) AS MAX_DATE FROM (tblIncident LEFT JOIN tblStatusHistory ON tblIncident.IncidentID = tblStatusHistory.IncidentID) INNER JOIN tblStatus ON tblIncident.STATUS = tblStatus.STATUS WHERE (((tblStatus.STATUS)='Active')) GROUP BY tblIncident.TICKET_NO;
Comment