Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Display The Words HAPPY BIRTHDAY on report

Featured Replies

Hi All, 

 

I have an issue with a calculation and I cannot seem to figure it out.

 

I run a theatre school and have pulled field to create a register where parents/members can sign in.  On the box where the signature goes I wanted to display the words "Happy Birthday" when i its the members Birthday within the next 10 days.

 

However the code I have displays the words with regardless and I cannot see where I am going wrong. The calculation also displays a number directly after the word i.e HAPPY BIRTHDAY1, HAPPY BIRTHDAY2. 

 

I am using FM starting point as my base and working in FM13.

 

Any help would be greatly received as I am a complete beginner. 

 

LeftWords("HAPPY BIRTHDAY";2) & (Abs(Date(Month(Get(CurrentDate)); Day(Get(CurrentDate)); 1997) + 10 - Date (Month(Birthday);Day(Birthday); 1997)) <= 10)

 

Hi All, 

 

I have an issue with a calculation and I cannot seem to figure it out.

 

I run a theatre school and have pulled field to create a register where parents/members can sign in.  On the box where the signature goes I wanted to display the words "Happy Birthday" when i its the members Birthday within the next 10 days.

 

However the code I have displays the words with regardless and I cannot see where I am going wrong. The calculation also displays a number directly after the word i.e HAPPY BIRTHDAY1, HAPPY BIRTHDAY2. 

 

I am using FM starting point as my base and working in FM13.

 

Any help would be greatly received as I am a complete beginner. 

 

What do you want the message to say? Just happy birthday or happy birthday and something else?

  • Author

What do you want the message to say? Just happy birthday or happy birthday and something else?

 

It would be nice to say "Happy Birthday from all at TTA". Thank you for your reply. 

It would be nice to say "Happy Birthday from all at TTA". Thank you for your reply. 

 

 

Well I would set up a calculated field for the message with the formula:

 

If ( Birthday ≥ Get ( CurrentDate ) and Birthday  ≤  Get ( CurrentDate ) +10 ; "Happy Birthday"; "")

 

If ( Day (Birthday) ≥  Day ( Get ( CurrentDate )) and  Day (Birthday) ≤  Day ( Get ( CurrentDate))+10 and Month( Birthday )= Month( Get (CurrentDate)) ; "Happy Birthday"; "")

 

See comments post below me!

If ( Birthday ≥ Get ( CurrentDate ) and Birthday  ≤  Get ( CurrentDate ) +10 ; "Happy Birthday"; "")

 

I doubt that Birthday will be ≥ the current date …

I doubt that Birthday will be ≥ the current date …

 

lol I'm an idiot...

The calculation also displays a number directly after the word i.e HAPPY BIRTHDAY1, HAPPY BIRTHDAY2.

 

That's not accurate: it never displays "HAPPY BIRTHDAY2". It shows either "HAPPY BIRTHDAY1" or "HAPPY BIRTHDAY0", depending on the condition being true or false. If you want the condition to affect the result, use it inside an If() or Case() function, for example:

If (
Abs(Date(Month(Get(CurrentDate)); Day(Get(CurrentDate)); 1997) + 10 - Date (Month(Birthday);Day(Birthday); 1997)) <= 10 ;
"HAPPY BIRTHDAY"
)

Note that:

 

1. LeftWords ("HAPPY BIRTHDAY" ; 2 ) is exactly the same thing as "HAPPY BIRTHDAY";

2. Your test will return true for 20 days following the birthday, not 10;

3. Your test will fail towards the end of the year.

and Month( Birthday )= Month( Get (CurrentDate))

 

Your calculation will never say "Happy Birthday" to people whose birthday is next month - even if today is the last day of the month and their birthday is tomorrow.

Your calculation will never say "Happy Birthday" to people whose birthday is next month - even if today is the last day of the month and their birthday is tomorrow.

 

Oh Yer :-(

OK, so if I may chime in, too …

Let ( [
t = Get ( CurrentDate ) ;
inFinal10 = Month ( t ) = 12 and Day ( t ) > 21 ;
target = Date ( Month ( Birthday ) ; Day ( Birthday ) ; Year ( t ) + inFinal10 )
] ;
Case (
target >= t and target <= t + 10 ;
"Happy Birthday from all at TTA."
) ) 
If you want something like “Happy 25. Birthday”, change the last line to 
"Happy " & Year ( target ) - Year ( Birthday ) & ". Birthday etc."

Here's another way to look at it:

Let ( [
today = Get ( CurrentDate ) ;
birthday =  Date ( Month ( Birthdate ) ; Day ( Birthdate) ; Year ( today ) ) ;
nextBirthday = Date ( Month ( Birthdate ) ; Day ( Birthdate) ; Year ( today ) + ( today > birthday ) )
] ;
Case ( nextBirthday < today + 10 ; "Happy Birthday" )
)

See also:

http://fmforums.com/forum/topic/48048-birthday-reminder-how-can-i-do-it/

Edited by comment

  • Author

Here's another way to look at it:

Let ( [
today = Get ( CurrentDate ) ;
birthday =  Date ( Month ( Birthdate ) ; Day ( Birthdate) ; Year ( today ) ) ;
nextBirthday = Date ( Month ( Birthdate ) ; Day ( Birthdate) ; Year ( today ) + ( today > birthday ) )
] ;
Case ( nextBirthday < today + 10 ; "Happy Birthday" )
)

See also:

http://fmforums.com/forum/topic/48048-birthday-reminder-how-can-i-do-it/

Thank you so much all. The above worked amazingly. Thank you so much. I just now need to try and understand and learn how it was put together for futire reference. I'm loving learning filemaker. 

Create an account or sign in to comment

Similar Content

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.