soci222 Posted December 24, 2003 Posted December 24, 2003 I have a field called date. I want to keep in my database records that are no more than 5 monts old. I assume that this can be done by a fm script or applescripts. But the fact is that I have no idea of how to do this. Can anyone help me please? Thanks in advance
kenneth2k1 Posted December 24, 2003 Posted December 24, 2003 Hi: I can help Doing this with a script would look something like this: Allow User Abort [off] Set Error Capture [on] Go to layout [layout with the date field] Enter Find Mode [ ] - Uncheck "Pause" and "Restore Find Requests" Insert Calculated Result [ "<" & DateToText(Date(Month(Status(CurrentDate)) - 5 , Day(Status(CurrentDate)) , Year(Status(CurrentDate)))) Perform Find [ ] If [status(CurrentFoundCount) = 0] Show Message ["No records were found"] Show All Records Else Delete All Records [Perform without dialog] Have fun! Ken
soci222 Posted January 29, 2004 Author Posted January 29, 2004 Thanks a lot, It works! I have a question though... Where are you telling in this script that the field you want to compare is a field called Date, in my case it works and it's not even called Date, it's called Fecha.
Vaughan Posted January 29, 2004 Posted January 29, 2004 "...it works and it's not even called Date, it's called Fecha..." Ahhh, that's the *magic* of FileMaker Pro!
John Caballero Posted January 29, 2004 Posted January 29, 2004 Actually he's raised an interesting question...he's basically asking into what field does the insert statement go into? I suspect that the date field in question just happens to be the first field (via tab order) on the layout.
Recommended Posts
This topic is 7607 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now