Listing birthdays script
I am having trouble trying to find a way to list all the birthdays within the next 30 days. I have 3 fields under table Clients.
1. BirthMonth ; 2. BirthDay; 3. BirthYear
Thank you for any help with this.
Define an unstored calculation field that computes the person's next birth day:
Let ( [ T = Get ( CurrentDate ) ;
Bd = Date ( BirthMonth ; BirthDay ; Year ( T ) ) ;
If ( Bd < T ; Date ( birthMonth ; BirthDay ; Year ( T ) + 1 ) ; Bd )
Now you can use a find script that uses this script step:
Set Field [ YourTable::cNextBirthDay ; Get ( CurrentDate ) & "..." & Get ( CurrentDate ) + 30 ]
See this thread for examples of find scripts that use Set Field to build find requests: Scripted Find Examples
Creating an unstored calculation field with:
and I keep getting, "A number, text constant, field name or "(" is expected here."
Let ( [ T = Get ( CurrentDate ) ; Bd = Date ( BirthMonth ; BirthDay ; Year ( T ) ) ]; If ( Bd < T ; Date ( birthMonth ; BirthDay ; Year ( T ) + 1 ) ; Bd ) )
might just need that closing bracket
That worked! One thing though, it seems to be bringing birthdays within next 30 days but it list some people that has already passed their birthday but also for next year.
That's exactly what it should do. It computes each person's next birthday. you then perform a search on this field to find those that have a birthday from today to 30 days into the future. See my original post.
Retrieving data ...