Expand my Community achievements bar.

SOLVED

How do I target customers who celebrate their birthday this week?

Avatar

Level 2

Hi,

I need to send an email to customers who celebrate their birthday this week.

I see I can create an expression based on the Month of the date of birth, and based on the day of date of birth.

Is there an option to only get those who celebrate their birthday this week? I could find a date expression I could use for that purpose.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@MariBa , Say you're running the campaign on Day-1 of the every week and need to target those who have birthday on this week, you can try below condition,

Day(@birthDate) on or after Day( GetDate())

AND

Day(@birthDate) on or before Day(AddDays( GetDate() , 7))

AND
Month(@birthDate) on or after Month( GetDate())

AND

Month(@birthDate) on or before Month(AddDays( GetDate() , 7))

ParthaSarathy_0-1741068101888.png

 

As a result, you can get all the recipients who has birthday this week:

ParthaSarathy_0-1741076477543.png

View solution in original post

9 Replies

Avatar

Community Advisor

Hi @MariBa ,

You can try the Query as,

ToInteger((DaysDiff(@birthDate, ToDateTime('01/01/'+Year(@birthDate))))/7)

Equals to

ToInteger((DaysDiff(GetDate(), ToDateTime('01/01/'+Year(GetDate()))))/7)

Avatar

Level 2

Thanks for the quick reply.

I tried it but the term "on or after" / "on or before" gets changed to "equal or greater than" / "equal or less than".

the outcome is all the customers whose birthday is today only. 

Avatar

Community Advisor

@MariBa , try the condition updated above. This calculates and compares the week of birth date in recipient's birth year and week of current week.

Avatar

Level 2

I tried the new condition but I'm getting an error.
I'm attaching print screens from the query. I can't seem to find what I'm doing wrong. maybe it has something to do with the account permissions? I'm not an admin.

 

MariBa_0-1740920131495.png

 

MariBa_1-1740920178366.png

 

 

Avatar

Level 1

Hi MariBa,

 

Do you still face the issue? I cannot see the error message from your screenshot. Can you add the error message, please? 

 

moreover, do you want to target all recipients on Monday, who have their birthday during the week (Monday to Friday) or just recipients who will have it in the next 7 days? 

 

Thanks 

Avatar

Level 2

Hi,
We've currently put this issue on hold.
If it comes up again, I'll try ParthaSarathy's additional suggestion.

Thank you so much for the quick response and follow up!
Marie

Avatar

Correct answer by
Community Advisor

@MariBa , Say you're running the campaign on Day-1 of the every week and need to target those who have birthday on this week, you can try below condition,

Day(@birthDate) on or after Day( GetDate())

AND

Day(@birthDate) on or before Day(AddDays( GetDate() , 7))

AND
Month(@birthDate) on or after Month( GetDate())

AND

Month(@birthDate) on or before Month(AddDays( GetDate() , 7))

ParthaSarathy_0-1741068101888.png

 

As a result, you can get all the recipients who has birthday this week:

ParthaSarathy_0-1741076477543.png

Avatar

Level 2

Hi,
We've currently put this issue on hold.
However, should it be relevant again, I'll try your latest suggestion and let you know if it worked.

 

Thanks for the quick response!

Marie

Avatar

Administrator

Hi @MariBa,

I am closing this issue for now, considering @ParthaSarathy's latest suggestion as the next step. If you’d like to revisit this query in the future and discuss further, feel free to reach out. I’d be happy to assist again in re-opening this

 



Sukrity Wadhwa