Jump to content

Finding records that have been added or modified within the last 7 days


taso
 Share

This topic is 5584 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • 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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Guest
Added gNumbDays
Link to comment
Share on other sites

This topic is 5584 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.