Avatar of House_sparrow
Flag for United States of America

asked on 

filter data, find the duplicates, sum one column from duplicates, return all data where sum > #

I have one table named TABLE: with columns: ID, YEAR, SPECIES, HARVEST, DATE

1) I need to restrict the records to SPECIES = X AND YEAR = Y
2) For those records I need to find all instances of a duplicate ID/DATE combination
3) For those duplicate ID/Date combinations I need to SUM the HARVEST
4) If SUM(HARVEST) > 100, then I want those records returned, if not then I don't want to see them.

I want the output to look like this:
ID     DATE                 HARVEST
3      12/12/200Y       55
3      12/12/200Y       55
4      01/03/200Y       60
4      01/03/200Y       10
4      01/03/200Y       40......etc

PLEASE HELP!  - Thanks!
DatabasesMicrosoft AccessSQL

Avatar of undefined
Last Comment

8/22/2022 - Mon