If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Birthdays in the past two weeks

Started by jessimica602, 16 Nov 2021 12:37:12 PM

Previous topic - Next topic

jessimica602

Hey all!

I got a request for a report that shows birthday in the past two weeks, I am having a bit of a struggle bus moment. I have their date of birth, I extracted the Month and the Day. I then did the same thing for the current date but honestly after that I am stuck on how to do this. I know I have to combine the month and day for both current date and the birthday back together and reference back two weeks.

Can I do this all in one expression? Easier to do multiple query calculations?

Thank you!

MFGF

Quote from: jessimica602 on 16 Nov 2021 12:37:12 PM
Hey all!

I got a request for a report that shows birthday in the past two weeks, I am having a bit of a struggle bus moment. I have their date of birth, I extracted the Month and the Day. I then did the same thing for the current date but honestly after that I am stuck on how to do this. I know I have to combine the month and day for both current date and the birthday back together and reference back two weeks.

Can I do this all in one expression? Easier to do multiple query calculations?

Thank you!

Hi,

Have you looked at the _age() function? You plug in the date of birth as the argument, and the result comes back as a number in the form YYYYMMDD. You'd then be looking for the last four digits to be 0014 or smaller. You can isolate the part you need using the mod() function.

Try this expression:

mod(_age([Your date of birth date item]),10000)

This will return items that look like

1112
215
110
1100
308
7
13
etc

Filter the results for values of 14 or less, and you should have your list.

Cheers!

MF.
Meep!

jessimica602

Quote from: MFGF on 16 Nov 2021 02:05:21 PM

Try this expression:

mod(_age([Your date of birth date item]),10000)



You are a genius! That works beautifully!

Thank you so much for your help!!!