Date Calculation

General support questions.
Posts: 4
Joined: Thu Mar 30, 2006 11:29 am
PostPosted: Thu Mar 30, 2006 12:04 pm
Hello,
I am currently using FM7 Pro and am interested in performing a specific calculation based on a date field.

Our records are based on information gathered from people who log into our website, including the date they logged in. I'd like to be able to send follow-up letters to people 90 days after they log in. Is there a way to develop a report in FM that shows records created 90 days before dates entered in a date field?

I think (and I'm probably very wrong here) the script would start out something like this:
If [DatabaseName::Date < Get(CurrentDate)+90]
but then I get a little lost. Ideally, I'd like to show all records where (CurrentDate) = Date (a date entered in a field when record is created) + 90.

I'm a bit new to FM, so any help is appreciated.
Posts: 160
Joined: Sat Nov 29, 2003 12:26 pm
Location: Columbus, OH
PostPosted: Fri Mar 31, 2006 7:00 am
Greetings,

It sounds to me like the best approach would be to use a scripted find.

You can enter find mode, and then insert the date you want into the field in question.

You can do this easily in a script. Give it a shot, and let us know if you have any other questions.
Court Bowman, President
Cleveland Consulting, Inc.

http://www.clevelandconsulting.com/
Posts: 4
Joined: Thu Mar 30, 2006 11:29 am
PostPosted: Fri Mar 31, 2006 8:40 am
Using a scripted find is a good way to locate individual records where the comparison date is fixed (ie if I wanted to search for all records where the date entered in the field is greater than or equal to 90 days less than a fixed date, which in this case would be the current date)
That is essentially what I am looking for, except if I used a scripted find our employees would have to change the current date every time they wanted to locate the desired records.


What I'd like is a way to create a layout which shows everyone in the database who logged into our site 90 days before the current date.
And, if it's possible, a way to effecively use the "show custom dialog" function to remind employees when a record is greater than 90 days old.

Again, I'm fairly new to FM, so I apoligize if my wording is confusing.
Posts: 160
Joined: Sat Nov 29, 2003 12:26 pm
Location: Columbus, OH
PostPosted: Sat Apr 01, 2006 7:43 am
Not at all, your wording is fine. However find is what you want.

You do not need the custom dialog, the script can do the work for you. Your first script step will be:

Enter Find Mode (You will want to make sure that pause is unchecked). You do not need to specify any find requests.

Your next step is Insert Calculated Results. You will want to specify the date field in question and have "Select Entire Contents" checked. The calculated result you want to insert will be:
Code: Select all
"> " & GetAsText ( Get ( CurrentDate ) - 90 )

Then you can Perform Find as your final step, make sure to have "Specify Find Results" unchecked.

Let me know if you have any problems.
Court Bowman, President
Cleveland Consulting, Inc.

http://www.clevelandconsulting.com/
Posts: 4
Joined: Thu Mar 30, 2006 11:29 am
PostPosted: Mon Apr 03, 2006 9:08 am
Worked perfectly! :)
Just goes to show that the simplest solution is always the safest bet. Thanks for your help!

Return to General Support

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron
(855) SEEDCODE
[email protected]
Follow us: