Delete old records ? 
Author Message
 Delete old records ?

I want to delete all the records in my dbase that are older than one month
when I click a button or go to a new page.

Is there a way to do this with sql or VBScript ?



Sat, 31 Aug 2002 03:00:00 GMT  
 Delete old records ?
Try this:

Run this query when you click on the button:

DELETE FROM myTable WHERE (myTable.Date <= 1/1/1999)

http://www.askasp.com


Quote:
> I want to delete all the records in my dbase that are older than one month
> when I click a button or go to a new page.

> Is there a way to do this with sql or VBScript ?



Sat, 31 Aug 2002 03:00:00 GMT  
 Delete old records ?
Run this query on click...

DELETE FROM tableName WHERE DateDiff (mm, DateColumn, GetDate() ) > 1


Quote:
> I want to delete all the records in my dbase that are older than one month
> when I click a button or go to a new page.

> Is there a way to do this with sql or VBScript ?



Sat, 31 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. delete records that are older than a certain date

2. problem use old record to create new record

3. Deleting records from a recordset without deleting from the database

4. Deleted records when text file is linked as table (#deleted)

5. DELETE statement (deleting but 0 records affected)

6. Delete a deleted record

7. Deleting old files

8. Script to delete files older than a specific date in a directory

9. Delete Files 3 days old

10. Find files in a folder and delete them if older then 2 dayx

11. Delete files older than n days.

12. Delete oldest file

 

 
Powered by phpBB® Forum Software