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

clearing table values

Status
Not open for further replies.

skate

Technical User
Nov 29, 2002
65
CA
this may be a simple question, but i just can't figure it out. I have a database who's entries need to be cleared to zero at the end of every year. I would prefer to do this than just delete all records as there is some data that needs to be saved. I can't simply highlight all the cells in the table and press clear/zero. How can I do this?

Thanks
 
Use an Update statement
Code:
UPDATE tbl SET F2 = 0, F5 = 0, F8 = 0, etc.
 
Skate,

I would suggest that you not do this. Why throw away data? There are many reasons to have a fresh set of data for a new year, but unless there's some serious privacy concern, I can't see a reason to throw away data. If it's not a gazillion records, I would say just add a field to your table to hold the year, then you can just write all your queries on that table to select for the year. If it's more than a gazillion, I'd just archive it out. Make a new database. Import that table. Put it somewhere. Go back to the original database and make a copy of the table (structure only). Then blow away the original table and rename the new one with the old one's name. Then compact your database. MUCH faster than a delete query.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top