danielgraham
03-09-2004, 04:48 AM
Ok,
I have a databse with dates when the data was set up. now the database is getting to large i would like to have a button that says export data. that will export data to a second database and delete the data it exported that is in this one. but i would like it to have 28 days of new data all the time.
please please.
i dont know where to start...
GrahamB
03-09-2004, 06:10 AM
Use a Make Table query (from the query menu in queries) to create a table from your main db (Make Table can be in another database), pulling out all records where Date()-[Creation Date] > 28. Then Using a Delete Query remove the data that is older than 28 days from your original table. Then use an Append Query to add the data from your new table to an Archieve table along with all the other records from the past.
By using a second table as a stepping stone you will find that if there is some sort of problem you will always have a copy of the data in at least one location.
Hope this helps.
danielgraham
03-09-2004, 07:02 AM
I dont understand.
ALL I WANT IS TO PRESS A BUTTON AND I WILL DO IT. OK. I HAVE ADDED AN ATACHMENT.
PLEASE HELP
DANEIL
Mile-O
03-09-2004, 07:06 AM
aLL I WANT IS TO PRESS A BUTTON AND I WILL DO IT. OK. I HAVE ADDED AN ATACHMENT.
YES, BUT YOU WILL HAVE TO DO THE QUERY FIRST AND THEN WRITE THE CODE THAT RUNS THE QUERY WHEN YOU CLICK THE BUTTON. YOU'VE BEEN TOLD HOW TO DO THAT.
P.S. Please don't shout; it's rude. :rolleyes:
danielgraham
03-09-2004, 07:35 AM
OK,
But i dont understand. say i have 128 days of data. in the query i only want it to see 100 days of data.(Hide the last 4 weeks) where do i make the query and how would i delete all data after making the data.
thanks
daniel
jfgambit
03-09-2004, 08:14 AM
Although it seems like a waste of good server space :D
Here is an example...