What is the purpose for doing this?
It would be much simpler if you just saved a copy of the entire file to a different filename that always contained all of the records. Why delete some of them?
Are you actually wanting a backup here or a log of activity on the solution?
@PhilModlunk, The purpose of this is to save or backup daily (date/day is the filename) the current records of that specific day transactions in the destination storage and then clear the records of that day transactions after printing the records and closing the file. So that the following day when they open the system, it is clear and ready to receieved that particular day transactions and at the end of the day when they finished printing and closing the file, the same process will occur. Backup to the destination storage then clear the system for the following day transactions.
Else please provide the script that will save all transactions in the database but if I want to print the particular date or that particular day, then I will find that date/day first and then show all that records then print it. Is that possible Phil?
@rjlevesque, Yes, actually I want to automatically backup (using script) that daily transactions to the destination storage at the end of the day after printing that transactions as thier hard copy and then press the close button to close the file, In case I want to print that particular day/date, I'll find it again and print that records or transactions.
Please help guys
I don't see any advantage to segregating your data into separate files each for a different day's transactions. We routinely back up our transactions here on both hourly and nightly back ups (Nightly ones are verified and copied to external locations.), but we back up the entire file. Pulling up the transactions for a specified date is as simple as performing a find for records for that day. We use a schedule on FileMaker Server to do this, but a script that uses Save a copy can do this for files that are not hosted by server.
By keeping the data together in a single file, you can also pull up summary reports on multiple days of business. Several of our reports are intended to span a time period of a specified start and end date, a specified month, quarter or year. We even have a 5 year comparsion chart that computes monthly totals over a specified 5 year interval. We would not be able to produce such reports if the data were split up like this...
Our back up script looks like this:
Set variable [$Path ; Value: //Path to backup directory goes here/ Get ( FileName ) & Let ( t = get ( Currentdate ) ; Year ( t ) & "-" & Right ( "0" & Month ( t ) ; 2 ) & "-" & Right ( "0" & day ( t ) ; 2 ) & ".fp7" ) ]
This saves the file to the specified location with the same name as the open file, but with today's date encoded into the file name so that multiple copies can be saved without overwriting existing copies. It's set up with the year first so that file names sort in correct order when you open the back up directory.
absolutely nothing to add here, Phil is 100% correct and covered it all...