gadfly Posted October 8, 2004 Posted October 8, 2004 I'm trying to create a simple If statement for a membership database. I want to use a simple calculation like this: If ( ExpirationDate < TODAY ; "expired" ; "active") but I can't figure out how to substitute the current date for TODAY. What's the simplest solution? (I've been using FMPro for years (since version 3) but I've never really done anything with date calculations.) TIA
MoonShadow Posted October 8, 2004 Posted October 8, 2004 Hi gadfly, welcome to FM Forums Your calculation should be text, unstored: If(ExpirationDate < Get(CurrentDate); "Expired"; "Active") Can the ExpirationDate ever be empty? If you wish it to display "Expired" if there is no expiration date, unclick the checkbox in your calc dialog which says, "Do Not Evaluate If All Referenced Fields Are Empty."
gadfly Posted October 8, 2004 Author Posted October 8, 2004 How cool! My help comes from MoonShadow just minutes after I left the TV after watching Yusef Islam (Cat Stevens) on Larry King Live. He even made a reference to the song, "Moon Shadow." Nice coincidence, since that's the first song I ever tried to learn on guitar. I though I had tried Get(CurrentDate) and it didn't work but maybe I had some other error getting in the way. Anyway, thanks for that. Now my next question: I have a ClientList table that includes a portal to display the current card Status from the ClientCard table (where the calculation field is). As it works now, the portal displays the results from the last time the calculation was performed which may have been before today. Is there a way to force the ClientCard table to recalculate the Status field so that references to it are always up to date?
MoonShadow Posted October 8, 2004 Posted October 8, 2004 Very cool indeed, gadfly, like Twilight Zone coincidence! Is there a way to force the ClientCard table to recalculate the Status field so that references to it are always up to date? That's the part I specified about making the calculation unstored. From within your calculation dialog, click 'Storage Options' and click 'Do Not Store Calculation Results...' It will always be up-to-date this way, even as the current date changes.
gadfly Posted October 8, 2004 Author Posted October 8, 2004 Thank you very much. My next question will be a little more challenging, I think...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now