HOW Check "YYYY" date value - Event Reports

Hi Dears
Happy New Year! I wish you much success and enthusiasm with it.
I need your help and my quesion is
In event reports, how can I check only the year “yyyy” of the date value? As we all know, must be entered in the format YYYY-MM-DD.
Or can you make any suggestions to help me solve this issue?

Dear @sami.oracle10g

A happy New year to you to,
You will need to use a d2 substring function

like … d2:substring(Eventdate, 1, 4) == ‘XXXX’

Regards

2 Likes

Thanks a lot for your swift response. Please keep in mind that I am referring to event reports, which, as you are aware, lack expression. find attached and let me if its okay to add d2.substring(eventdate,1,4)==‘xxxx’

Oops sorry, You mean you want to select for a given year or years?

  1. If this is based on the event date then you can use the period selection

  2. But if this on the dare data element, then you will have to create a program rule that assigns to another data element to store only the year (YYYY) and thats what you can use in the events report

Regards

3 Likes

its great idea.

1 Like

Hello @sami.oracle10g ,

Did you have a chance to try the suggested solution by @prosper , I think It would solve the issue, COuld you please feedback us once you have a chance to try it?

Thank you,

1 Like

You are right It’s logical and suitable solution.I will try it and feedback you

2 Likes

Hi @prosper
I have tried to use the substring, but it gets three digits only. For instance, on 1, 1, 2023, the result is 023. Then I tried to use the left function, and it went well.

By the way, I wanted to thank you very much and share my experience.