Select recipients DOB between 2 specific date | Community
Skip to main content
New Participant
September 19, 2022
Solved

Select recipients DOB between 2 specific date

  • September 19, 2022
  • 3 replies
  • 1114 views

Hello

 

I  need to filter people from my targeting with date of birth is between for example Aug 21 and Dec 23.

I tried a query like:

day of date of birth of targeting dimension greater than or equal to 23 and month of date of birth of targeting dimension greater than or equal to 8

But seems not what I want, I need to send a communication for the people when date of birth is between this two dates above. Any ideas?

 

Thank you

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by david--garcia

Perhaps something like the following?

 

 

0|Month(@birthDate)|12|=|||||0|/|0
0||||AND||||1|/|0
0|Day(@birthDate)|21|>=|||||0|/|1
0|Day(@birthDate)|23|<=|AND||||0|/|1
<ctx helpCond="Query: month of date of birth equal to 12 and (day of date of birth greater than or equal to 21 and day of date of birth less than or equal to 23)">
  <queryDef hideOrderby="true" hideSelect="true" label="Recipients" namespace="nms"
            operation="select" schema="nms:recipient" startPath="/" xtkschema="xtk:queryDef">
    <where displayFilter="month of date of birth equal to 12 and (day of date of birth greater than or equal to 21 and day of date of birth less than or equal to 23)">
      <condition boolOperator="AND" compositeKey="" dependkey="" enabledIf="" expr="Month(@birthDate) = 12"
                 internalId="0"/>
      <condition boolOperator="AND" internalId="1">
        <condition boolOperator="AND" compositeKey="" dependkey="" enabledIf="" expr="Day(@birthDate) &gt;= 21"
                   internalId="2772501133"/>
        <condition compositeKey="" dependkey="" enabledIf="" expr="Day(@birthDate) &lt;= 23"
                   internalId="2774336146"/>
      </condition>
    </where>
  </queryDef>
  <ignored _isNewEntity="false"/>
</ctx>

3 replies

Sukrity_Wadhwa
Employee
October 19, 2022

Hi @rbiri,

Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know. In case the given solutions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!

Sukrity Wadhwa
AkshayAnand
New Participant
September 20, 2022

Hi @rbiri 

 

You can also try creating the below query 

which will give the result as 

filtered to 

 

If you want all the records regardless of the year then you can choose the query below 

 

Regards

 

david--garcia
david--garciaAccepted solution
New Participant
September 20, 2022

Perhaps something like the following?

 

 

0|Month(@birthDate)|12|=|||||0|/|0
0||||AND||||1|/|0
0|Day(@birthDate)|21|>=|||||0|/|1
0|Day(@birthDate)|23|<=|AND||||0|/|1
<ctx helpCond="Query: month of date of birth equal to 12 and (day of date of birth greater than or equal to 21 and day of date of birth less than or equal to 23)">
  <queryDef hideOrderby="true" hideSelect="true" label="Recipients" namespace="nms"
            operation="select" schema="nms:recipient" startPath="/" xtkschema="xtk:queryDef">
    <where displayFilter="month of date of birth equal to 12 and (day of date of birth greater than or equal to 21 and day of date of birth less than or equal to 23)">
      <condition boolOperator="AND" compositeKey="" dependkey="" enabledIf="" expr="Month(@birthDate) = 12"
                 internalId="0"/>
      <condition boolOperator="AND" internalId="1">
        <condition boolOperator="AND" compositeKey="" dependkey="" enabledIf="" expr="Day(@birthDate) &gt;= 21"
                   internalId="2772501133"/>
        <condition compositeKey="" dependkey="" enabledIf="" expr="Day(@birthDate) &lt;= 23"
                   internalId="2774336146"/>
      </condition>
    </where>
  </queryDef>
  <ignored _isNewEntity="false"/>
</ctx>