Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button to remove data stored in a table that is a month old

Status
Not open for further replies.

antm2209

Technical User
Jun 19, 2008
4
GB
Hi,

I am trying to create a button that will delete records in a table that is a month old from todays date, as they will no longer be needed.

How could i do this, would i need to use a macro or query and if anyone could please tell me how i could accomplish this.

Any help would be great thank you
 
Code:
LOCAL ldMonthOld
ldMonthOld = GOMONTH(DATE(), -1)
DELETE FROM YourTable FOR SomeDateField <[COLOR=blue]=[/color] ldMonthOld

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
Microsoft MVP VFP
 
Thank You so much for your time, just got it working :D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top