Jump to content
  • 0
FinTheHuman

Display Birthday Message

Question

6 answers to this question

Recommended Posts

  • 0

Hello @FinTheHuman,

If you are using a report DataPage to display the Birthday message, then you can use calculated field with formula to generate the message you wanted.

You can try using this formula:

CASE 

WHEN Datediff(Month,[@field:Birthday],GetUTCDate())=0 AND Datediff(Day,[@field:Birthday],GetUTCDate())=0 THEN 'Happy Birthday to you!'

ELSE 'Not your birthday yet !'

END

For further instruction, you check this documentation: Calculated Field

I hope this helps :)

~WatashiwaJin~

Share this post


Link to post
Share on other sites
  • 0

Hi @FinTheHuman,

This is also might be helpful to you, the report will display the days remaining before the user's birthday.

CASE 

WHEN Datediff(Month,[@field:Birthday],GetUTCDate())=0 AND Datediff(Day,[@field:Birthday],GetUTCDate())=0 THEN 'Happy Birthday to you!'

ELSE CONVERT(VARCHAR(10), Datediff(Day,[@field:Birthday],GetUTCDate()), 101) + " days, before your Birthday"
END

I hope this helps :)

~WatashiwaJin~

Share this post


Link to post
Share on other sites
  • 0

Just to add to the previous comment, I just noticed this recently,

When a Field for Birthdate is equal to, say December 2018, and it is now January 2019, using "Datediff(Year,[@field:Birthday],GetUTCDate())" as a formula would give me a "1 year" as result, when in fact it should not. I guess it's because I used "Year" as the DateDiff option.

What I did was "Datediff(Month,[@field:Birthday],GetUTCDate())/12", it did somehow responds to the age correctly, but when my birth month comes, it adds to my age. I can accept that tho.

So just in case someone encounter the same problem, I hope this helps! :D:D 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...