Jump to content
Sign in to follow this  
The Sparrow

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

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!

Share this post


Link to post
Share on other sites

Do not double post in the Forum, I have deleted your other two post on the same topic.

Lee

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Ender,

I have entered the script you recommended, yet when i click on the button to launch the search, it says there are no records that match the request. any ideas? thanks.

Sparrow

Share this post


Link to post
Share on other sites

In version 6, you need to use Insert Calculated Result[] instead of Set Field[], when entering a non-date into a date field.

Share this post


Link to post
Share on other sites

i am not entering any non-dates. each of my records has a field called DATE ADDED which is auto-filled using the current system date in standard MM/DD/YYYY format...

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Who Viewed the Topic

    1 member has viewed this topic:
    MartieH 
×

Important Information

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