Jump to content

find birthday at file opening


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

Recommended Posts

Dear All,

I have searched for this in the Forum and have also found some solutions but it was for fmp7 and I guess I can't use the same syntax for my script in fmp5.

Here's what I'd like to do: at opening of the databse I want to assign a script (at edit/prefs/document...) that runs and finds the birthday of somebody - but one day before his actual birthday, so I can send him a card or email etc. I have tried to calculate my field DOB in the script, set field to ... etc etc but haven't gotten to the proper syntax - I give up!

Thanks for your help...

Andy

Link to comment
Share on other sites

The calc would be:

Day ( DOB ) = Day ( Status (CurrentDate) + 1 )

and

Month ( DOB ) = Month ( Status (CurrentDate) + 1 )

You could put this in a calc field cBirthday (result is number, unstored) and find records where cBirthday = 1.

Or, you could add a field cBirthday (result is text, stored) =

Month ( DOB ) & "|" & Day ( DOB )

Then in your find script go to Find mode and set field cBirthday to:

Month ( Status (CurrentDate) + 1 ) & "|" & Day ( Status (CurrentDate) + 1 )

--- EDIT ---

I am afraid I don't have an elegant solution for those who have been born on February 29. Let me think...

Link to comment
Share on other sites

How about an unstored calc field of Date( Month(DOB), Day(DOB), Year(Status(CurrentDate)) ) - 1 ? Then you can perform a find for today's date in it. Unless you have thousands of records, this shouldn't be too slow.

Link to comment
Share on other sites

One more thing in regards to this: if my scsript doesn't find a birthday, is there a way to eliminate the error message "no matching records found"? It might confuse my users a little if the message pops up every day.

Thanks,

Andy

Link to comment
Share on other sites

This topic is 6992 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.