Automating an Archive Procedure

K

Keith

I have a basic single-table Access DB which is used as a log for a network
device. The log fills up with a new record for each instance.

Obviously the log grows greatly depending on activity.

Every month I manually take the log off-line, copy it, and delete all
entries from the copy that are not for that month, and all entries that are
for that month from the 'current log.

Therefore creating an archive of a months activity and clearing out that
data from the working log.

Is there a way of automating this? There is a field which records
date/time.
 
A

Arvin Meyer

You can automate almost anything, but it isn't trivial. You need consistency
(specific file paths, dates to run the queries when no one will be in the
database, etc.) . The query to select the previous month's data would be
something like:

Select * From YourTable Where YourDateField Between
DateSerial(Year(Now()),Month(Now())-1,1) And DateSerial(Year(Now()),
Month(Now()), 0)
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top