T
toosh27
Guest
Hi
I'm trying to run a query which will remove records that have a duplicated value in a field called "REFVAL". The query uses only one table, called "tblTemp" and writes the results to another table called "tbltemp1". I'm new to SQL and I keep getting a syntax error.
The error is "You tried to execute a query that does not include the specified expression 'CPUSE' as part of an aggregate function"
The SQL code is "SELECT tblTemp.CPUSE, tblTemp.REFVAL, tblTemp.TRADEAS, tblTemp.ADDRESS, tblTemp.LASTINSP, tblTemp.NEXTINSD, tblTemp.CLOSEDD, tblTemp.EHINSTYPE INTO tblTemp1 FROM tblTemp GROUP BY tblTemp.REFVAL HAVING Count(*) > 1;"
Any help would be very much appreciated
Simon
I'm trying to run a query which will remove records that have a duplicated value in a field called "REFVAL". The query uses only one table, called "tblTemp" and writes the results to another table called "tbltemp1". I'm new to SQL and I keep getting a syntax error.
The error is "You tried to execute a query that does not include the specified expression 'CPUSE' as part of an aggregate function"
The SQL code is "SELECT tblTemp.CPUSE, tblTemp.REFVAL, tblTemp.TRADEAS, tblTemp.ADDRESS, tblTemp.LASTINSP, tblTemp.NEXTINSD, tblTemp.CLOSEDD, tblTemp.EHINSTYPE INTO tblTemp1 FROM tblTemp GROUP BY tblTemp.REFVAL HAVING Count(*) > 1;"
Any help would be very much appreciated
Simon