P
Paul James
I'm trying to create a SQL statement that will delete all records in a table
where the values in a particular field are less than the maximum value. So
after this statement is executed, the only remaining record in the table
will be the one with the largest value in that field.
My table is named tblTMAAgentID, and the field is named AgentID.
I tried using the following statement:
currentdb.Execute "DELETE * FROM tblTMAAgentID WHERE AgentID < Max(AgentID)"
but I get an error message saying that I can't have the Max(AgentID)
aggregate function in a WHERE clause.
Can someone please tell me how to write the SQL statement so I can
accomplish my objective?
Thanks in advance,
Paul
where the values in a particular field are less than the maximum value. So
after this statement is executed, the only remaining record in the table
will be the one with the largest value in that field.
My table is named tblTMAAgentID, and the field is named AgentID.
I tried using the following statement:
currentdb.Execute "DELETE * FROM tblTMAAgentID WHERE AgentID < Max(AgentID)"
but I get an error message saying that I can't have the Max(AgentID)
aggregate function in a WHERE clause.
Can someone please tell me how to write the SQL statement so I can
accomplish my objective?
Thanks in advance,
Paul