Link to home
Start Free TrialLog in
Avatar of coperations07
coperations07Flag for United States of America

asked on

SQL Update Criteria

Hi,
I'm trying to create an update query that will update a table in Access. I want to flag all the records that have duplicate values in one of the columns. The flag will be a 'N' value in a corresponding column for a dupe record. I have two queries that I've been trying to make work together, but no luck so far.
To set the flag:
UPDATE tbl_os_reverse_save SET tbl_os_reverse_save.FILL = Left([tbl_os_reverse_save]![FILL],Len([tbl_os_reverse_save]![FILL])-1) & 'N'

To find the dupes:
SELECT First(tbl_os_reverse_save.[WHLSL AGIN]) AS [WHLSL AGIN Field], Count(tbl_os_reverse_save.[WHLSL AGIN]) AS NumberOfDups
FROM tbl_os_reverse_save
GROUP BY tbl_os_reverse_save.[WHLSL AGIN]
HAVING (((Count(tbl_os_reverse_save.[WHLSL AGIN]))>1))
ASKER CERTIFIED SOLUTION
Avatar of 8080_Diver
8080_Diver
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coperations07

ASKER

That's what I needed. Thanks!