August 14, 200619 yr Newbies Newbie question ... I'm using a database with a creation date field, and a modification date field. I'd like to find records that have been created or modified within a specified number of days, and then create a script for this. Can anyone help?
August 14, 200619 yr For a simple find, Read the manual and/or the Online Help when FileMaker is open. What you are looking for is [color:blue]Finding ranges of information. If you need to do this often, consider a script using the Find Script Step. Lee
August 14, 200619 yr You will only need to search for the Modification Date. When a record is created, the Modification Date grabs the Creation Date the first time. With vs. 6, you can't set a date field with a calculated result. So you need to use Insert Calculated Result and that means that the Modification Date must be on the layout. Pseudo-script would look something like this: Go To Layout [ layout containing Modification Date ] Set Error Capture [ On ] Enter Find Mode [ ] ... uncheck pause Insert Calculated Result [ Modification Date ; ">=" & Status ( CurrentDate ) - [color:green]If ( gNumbDays , gNumbDays , 6 ) ] Perform Find [ Replace ] If [ not Status ( CurrentFoundCount ) ] Show Message [ "No records modified since " & Status ( CurrentDate ) - [color:green]If ( gNumbDays , gNumbDays , 6 ) ] Show All Records Go To Layout [ original layout ] Halt Script End If ... do whatever you wish with the modified found set. If you wish to specify a different number of days for the search, insert a number in gNumbDays. If you leave it blank, it will assume default of 6. Edited August 14, 200619 yr by Guest Added gNumbDays
Create an account or sign in to comment