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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Archive Old Data Via Two Years Old

Status
Not open for further replies.

bswan

Programmer
Joined
Jun 7, 2010
Messages
1
Location
US
I have two tables, one is tbmonthly, and the other is tbmonthlyarchive. I am attempting for the life of me to use get date and then convert today's date to the 1st of the month, using the dateadd function to subtract two years.

Can anyone help me with a little legend code regarding this? I have the inserts

Essentially I'm just looking for help on the code to make one table move data more than 2 years old to the archived table. Anyone have legend code that works well for them?
 
Check out this FAQ about tips and tricks about DATETIME. Item 5 should help you out....but take time to look at some of the other items/examples as they may come in handy some time.

FAQ183-5842

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top