-
01-16-2010 06:16 PM #1Guest Member
- Join Date
- Jan 2010
- Posts
- 3
- Location:
- USA
- FM Version
- Filemaker Pro 10 Advanced
- Skill Level
- Entry Level
- OS
- Windows
- Rep Power
- 0
Comparing dates and auto filling another field based on the result
Hi !
I hope I explain this well enough for someone to help me. I have a field (MembExpDate) that contains a membership date - such as 02/20/2010. I would like to check the membership date against the current date to see if it is plus or minus 30 days and enter $30 into another field (Dues_Amount) if it is and leave it blank if it isn't. This is what I've tried but it doesn't work. This is probably obvious to everyone except me!
Dues_Amount
Case ( Get (CurrentDate) - MembExpDate < 1 ; "" ;
Get (CurrentDate) - MembExpDate > 1 ; 30 )
Any help would be greatly appreciated.
Thanks,
Jim
-
01-16-2010 07:03 PM #2FileMaker Mentor
- Join Date
- Aug 2006
- Posts
- 8,033
- Location:
- New York (Manhattan) USA
- FM Version
- 10, 9, 8.5, 8, 7, 6, 5.5., 5, 4.1, 4, 3, 2.1, 1, II; & Nashoba 4, Plus, and the Original
- Skill Level
- Developer
- OS
- Windows & Mac
- Rep Power
- 156
Re: Comparing dates and auto filling another field based on the result
I don't see anything wrong with your formula; the one thing you need to know about calc fields that reference "status" functions such as Get (CurrentDate) or Get (SystemPlatform) and so forth is that you have to set the storage (via the storage tab in the field definition of that field) to "unstored — calculate as needed"; if you do not, it will not notice when the "current date" changes; it will not roll over and therefore will not "work".
This means you can't use such a field on the remote side (portal side, right hand side, etc) of a relationship because an unstored field cannot be indexed. But as long as that was not your intention (e.g., you intended to do a standard FIND for expired dates, or just to have them display onscreen), that change by itself should put you in business.
-
01-16-2010 07:16 PM #3Guest Member
- Join Date
- Jan 2010
- Posts
- 3
- Location:
- USA
- FM Version
- Filemaker Pro 10 Advanced
- Skill Level
- Entry Level
- OS
- Windows
- Rep Power
- 0
Re: Comparing dates and auto filling another field based on the result
AHunter3,
I didn't have it set to unstored but even when I make that change it doesn't work. The funny thing is I have 2 records that have the dates of:
11/03/2008 and
11/22/2009
These show the $30.00 amount in the proper field like I want. Others that have Feb. 7, 2010 and such show blank. I realize I'm missing something but I can't figure out what it is.
Thanks for your help. Any other suggestions?
Jim
-
01-16-2010 07:44 PM #4FileMaker Mentor
- Join Date
- Aug 2006
- Posts
- 8,033
- Location:
- New York (Manhattan) USA
- FM Version
- 10, 9, 8.5, 8, 7, 6, 5.5., 5, 4.1, 4, 3, 2.1, 1, II; & Nashoba 4, Plus, and the Original
- Skill Level
- Developer
- OS
- Windows & Mac
- Rep Power
- 156
Re: Comparing dates and auto filling another field based on the result
Yes, as I would expect.
I would expect that as well.Others that have Feb. 7, 2010 and such show blank.
I am realizing that *I* am missing something: an example of a date that gives you a result that you did not expect or that you consider to be wrong?I realize I'm missing something but I can't figure out what it is.
-
01-16-2010 08:03 PM #5Guest Member
- Join Date
- Jan 2010
- Posts
- 3
- Location:
- USA
- FM Version
- Filemaker Pro 10 Advanced
- Skill Level
- Entry Level
- OS
- Windows
- Rep Power
- 0
Re: Comparing dates and auto filling another field based on the result
AHunter3,
I got it to work! I had to change the formula to this:
Case(MembExpDate - Get (CurrentDate) < 30; "30";
Get (CurrentDate)- MembExpDate > 30; "30")
I'm not sure I completely understand why but when I check it out using different data it works. If you see a major flaw in this please let me know.
Thanks a lot,
Jim
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads - The answer to your question may be in one of these posts!
-
Auto field filling
By timsonefelt in forum Calculations and Define FieldsReplies: 4Last Post: 05-07-2009, 11:15 AM -
Auto Filling line items based on master record?
By RichGags in forum FileMaker Pro 9Replies: 8Last Post: 10-14-2008, 10:37 AM -
Field Validation based on result
By orangej in forum FileMaker Pro 9Replies: 3Last Post: 01-06-2008, 12:20 AM -
Auto Filling 3rd conditional field
By DOS in forum Value ListsReplies: 4Last Post: 11-27-2006, 12:52 AM -
Automatically filling in a field based on the user
By PMR in forum FileMaker Pro 7.0Replies: 2Last Post: 06-08-2005, 02:33 PM

























































Reply With Quote


Bookmarks