A
abaker.junk
Hi,
I have an MS Access Table that I use to store log information and it
looks something like this:
tblLog
ID Job SN Message Date
1 script1 abc123 Failure 1/1/2007
2 script2 abc123 Failure 1/1/2007
3 script2 abc123 Success 1/2/2007
4 script2 def456 Success 1/2/2007
5 script1 def456 Success 1/9/2007
6 script1 def456 Failure 1/10/2007
7 script1 abc123 Success 1/10/2007
I would like to create a query that would delete all of the old
information. In other words, I only want to keep the data from the
last time the script was run.
If I were going to select the data, I would use something like this:
SELECT tblLog.job, tblLog.SN, Max(tblLog.Date) AS MaxOfDate
FROM tblLog
GROUP BY tblLog.job, tblLog.SN
How would I create a delete statement that would delete everything but
what appears in this select statement?
I have an MS Access Table that I use to store log information and it
looks something like this:
tblLog
ID Job SN Message Date
1 script1 abc123 Failure 1/1/2007
2 script2 abc123 Failure 1/1/2007
3 script2 abc123 Success 1/2/2007
4 script2 def456 Success 1/2/2007
5 script1 def456 Success 1/9/2007
6 script1 def456 Failure 1/10/2007
7 script1 abc123 Success 1/10/2007
I would like to create a query that would delete all of the old
information. In other words, I only want to keep the data from the
last time the script was run.
If I were going to select the data, I would use something like this:
SELECT tblLog.job, tblLog.SN, Max(tblLog.Date) AS MaxOfDate
FROM tblLog
GROUP BY tblLog.job, tblLog.SN
How would I create a delete statement that would delete everything but
what appears in this select statement?