Hello again,
Can anybody help me in finding if any of my contacts have a birthday coming up in the next 7 days or so, in my clients file I have a birthday date field and I would like to run a script that goes and searches for upcoming birthdays then goes to a new layout showing me all matching records.
Thanks,
roy
Birthday date find
3 posts
• Page 1 of 1
Posts: 25
Joined: Sat Aug 12, 2006 2:34 am |
|
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am |
Sure. This is a bit easier if you have a clac that transforms the birthday into their "next" birthday for searches. Something like:
Let ( [ d = Get ( CurrentDate ) ; bd = Date ( Month ( BirthdayField ) ; Day (BirthdayField ) ; Year ( d ) ) ] ; if ( bd < d , Date ( Month ( bd ) ; Day ( bd ) ; Year ( d ) + 1 ) ; bd ) ) Then you can script a date range find by having your script go your contact's layout, enter find mode, and then use InsertCalculatedResult to insert something like the following into the birthday calc field above: Get ( CurrentDate ) & "..." & Get ( CurrentDate ) + 7 John Sindelar
SeedCode |
Posts: 25
Joined: Sat Aug 12, 2006 2:34 am |
Thanks John,
always the right response so quickly. I'm almost bald trying to work that one out!!! Many thanks again. Roy |
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests