Jump to content

finding "30 days ago" without having to enter an actual date


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

Recommended Posts

i'm hoping there is already a way to do this. so far i know that i can type "//" to indicate the current date. what i'm trying to do is indicate a range in find mode that would return records entered from 30 days ago through the current date without having to type in any actual dates. right now i'm having to settle for using, for example, "4/22/2007...//" to indicate the range from 30 days ago through today. tomorrow, the range will only update on one end. the 4/22 won't update to 4/23. that's why i wanted to use "//-30" for that end of the range. can anyone tell me if there's a way to do this? i'm using FileMaker Pro 6. thanks!

Link to comment
Share on other sites

You could do it with a button tied to a script:

Enter Find Mode[]

Set Field [ Date , status(currentdate)-30 & ".." & status(currentdate) ]

Perform Find[]

In FM8, there are some other options for finding with wildcards, like 4/*/2007, but that's not exactly what you're looking for.

If your dates don't go into the future, you can also use an open range Find, in the form:

>4/21/07

or

>=4/21/07

Edited by Guest
Link to comment
Share on other sites

Ender,

the way i understand Set Field is that it enters the result of a calculation into a specified field. i have been able to get your suggested script to work if i simplify it to:

Enter Find Mode[]

Set Field ["DATE ADDED", "Status(CurrentDate)-30"]

Perform Find[]

which does automate the "30 days ago", but it ONLY finds exactly 30 days ago.

the result of the calculation must be a date. i start having problems when i try to Set Field to more than one date or a range of dates. is that supposed to be possible?

perhaps the syntax is a bit off?

you suggested:

Set Field ["DATE ADDED", status(currentdate)-30 & ".." & status(currentdate)]

which makes sense to me intuitively. but FileMaker doesn't seem to be translating that to "30 days ago thru Today".

any additional help from anyone would be greatly appreciated.

Link to comment
Share on other sites

This topic is 6156 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
×
×
  • Create New...

Important Information

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