How to create a macro to purge Form Fields

J

Jim in CT

I'm using Access 2000 as a backend database for an ecommerce web site.

Customers make a purchase, it's stored in the database and a gateway is used
to process the orders.

I want to write a macro which, when executed, probably by the IP server
side, will delete/purge customer information stored in the "Orders" Table,
greater than 72 hours old. This purge would be executed on a daily basis...
always keeping a minimum of 3 days of customer information.

There are about 30 fields of information within the "Orders" Table.

I am open to all suggestions.
 
S

Steve Schapel

Jim,

You can use a Delete Query for this. You don't say what software your
site is running on, etc, nor how the age of the order is recorded in the
Orders table, so it is difficult to advise specifically. But the SQL
view of the query will be something like this:
DELETE * FROM Orders WHERE [YourOrderDate]<Date()-3

.... or:
DELETE * FROM Orders WHERE [YourOrderDateTime]<DateDiff("h",-72,Now())

You can use an OpenQuery action in a macro to run the Delete Query,
although I imagine it may also be possible to use a procedure in the
site's code to run the SQL directly.
 

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