G
Guest
Ok, I have made a "Find Duplicates" query for my program. How can I
automatically delete the data with the lower idsArchiveID number?
Some background. Users are able to archive their data daily but sometimes
they archive twice, or more, in one day. When they go back to retrieve their
data they get every record that was archived and they cannot tell which data
is the most recent. How can I modify my "Find Duplicates" query to
automatically delete those records with the smaller ID number so that each
Bureau Number has one entry per date? Is there someway to use the Dmax
function? Any suggestions would be great.
Data:
Field: intBureauNumber
Table: tblAircraftDataArchive
Sort: Ascending
Criteria: In (SELECT [intBureauNumber] FROM [tblAircraftDataArchive] As Tmp
GROUP BY [intBureauNumber],[datStorageDate] HAVING Count(*)>1 And
[datStorageDate] = [tblAircraftDataArchive].[datStorageDate])
Field: datStorageDate
Table: tblAircraftDataArchive
Sort: Ascending
Field: idsArchiveID
Table: tblArchiveDataArchive
Sort: Ascending
intBureauNumber datStorageDate idsArchiveID Need to delete
157329 5/2/2005 3060 <-----
157329 5/2/2005 3087
157329 5/4/2005 3166 <-----
157329 5/4/2005 3173 <-----
157329 5/4/2005 3230 <-----
157329 5/4/2005 3237
Thanks,
Jeff
automatically delete the data with the lower idsArchiveID number?
Some background. Users are able to archive their data daily but sometimes
they archive twice, or more, in one day. When they go back to retrieve their
data they get every record that was archived and they cannot tell which data
is the most recent. How can I modify my "Find Duplicates" query to
automatically delete those records with the smaller ID number so that each
Bureau Number has one entry per date? Is there someway to use the Dmax
function? Any suggestions would be great.
Data:
Field: intBureauNumber
Table: tblAircraftDataArchive
Sort: Ascending
Criteria: In (SELECT [intBureauNumber] FROM [tblAircraftDataArchive] As Tmp
GROUP BY [intBureauNumber],[datStorageDate] HAVING Count(*)>1 And
[datStorageDate] = [tblAircraftDataArchive].[datStorageDate])
Field: datStorageDate
Table: tblAircraftDataArchive
Sort: Ascending
Field: idsArchiveID
Table: tblArchiveDataArchive
Sort: Ascending
intBureauNumber datStorageDate idsArchiveID Need to delete
157329 5/2/2005 3060 <-----
157329 5/2/2005 3087
157329 5/4/2005 3166 <-----
157329 5/4/2005 3173 <-----
157329 5/4/2005 3230 <-----
157329 5/4/2005 3237
Thanks,
Jeff