M
Melinda
Hello,
Access 97 problem here. I'm trying to create an SQL
statement to pick out the most recent date/time for each
JobCode in my table and then delete all of the records in
my table that don't have that date/time. Here is my code:
Dim dbs As Database, qdf As QueryDef, strSQL As String
Set dbs = CurrentDb
strSQL = "SELECT * FROM audWorkOrder2 WHERE Max
(audWorkOrder2.audDate)"
Set qdf = dbs.CreateQueryDef("MostRecent", strSQL)
Delete * FROM audWorkOrder2 WHERE
audWorkOrder2.audDate<>MostRecent
The problem is, I'm not sure how to tell VB to group my
Max audDate by JobCode. Also, the Delete * gives me a
compile error. Any ideas?
Thanks!
Melinda
Access 97 problem here. I'm trying to create an SQL
statement to pick out the most recent date/time for each
JobCode in my table and then delete all of the records in
my table that don't have that date/time. Here is my code:
Dim dbs As Database, qdf As QueryDef, strSQL As String
Set dbs = CurrentDb
strSQL = "SELECT * FROM audWorkOrder2 WHERE Max
(audWorkOrder2.audDate)"
Set qdf = dbs.CreateQueryDef("MostRecent", strSQL)
Delete * FROM audWorkOrder2 WHERE
audWorkOrder2.audDate<>MostRecent
The problem is, I'm not sure how to tell VB to group my
Max audDate by JobCode. Also, the Delete * gives me a
compile error. Any ideas?
Thanks!
Melinda