Expand my Community achievements bar.

Adobe Campaign User Groups are live now. Join our Adobe Campaign User Groups and connect with your local leaders!
SOLVED

DATE FORMAT

Avatar

Level 3

Hi all,

 

does anyone know how to express the following function in Adobe Campaign Classic?

 

"Creation date before an specific date" (show me every client who has been created before the 20th of december)

 

I have tried the following, but is not working:

bcollado_1-1703236359878.png

 

bcollado_0-1703236302552.png

Thanks in advance,

Blanca

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @bcollado,

As Amine mentioned, cross check whether your creation date field is datetime data type or string in your schema.

 

IF IT IS DATETIME, then don't use any expression in query and

Simply Select @created before (now in value field, you can able to see a calendar drop down) in it select December 20 2023.

So it will be like @created before 20/12/2023 00:00:00 (this will fetch all records created before 20th December 2023).

ParthaSarathy_0-1703462794825.png

 

If your field is STRING, either change the creationdate field's data type as datetime in schema 

Or,

In query, use expression to convert your string creationdate to datetime by using below expression,

DateOnly(ToDateTime(@creationDate)) before DateOnly('2023/12/20')

ParthaSarathy_1-1703463148564.png

View solution in original post

4 Replies

Avatar

Community Advisor

Hello @bcollado 

 

It seems like your CREATIONDATE field is an integer, could you double check please if it's a dateTime or an integer?

 

Br,

Amine

Avatar

Community Advisor

Hi @bcollado ,

 

Please try by giving single quotes in YYYY/MM/DD Format inside the DateOnly function at the right side of the Expression as shown below. It worked for me

 

LakshmiPravallika_0-1703240804924.png

 

LakshmiPravallika_1-1703240848107.png

Regards,

Pravallika.

 

Avatar

Correct answer by
Community Advisor

Hi @bcollado,

As Amine mentioned, cross check whether your creation date field is datetime data type or string in your schema.

 

IF IT IS DATETIME, then don't use any expression in query and

Simply Select @created before (now in value field, you can able to see a calendar drop down) in it select December 20 2023.

So it will be like @created before 20/12/2023 00:00:00 (this will fetch all records created before 20th December 2023).

ParthaSarathy_0-1703462794825.png

 

If your field is STRING, either change the creationdate field's data type as datetime in schema 

Or,

In query, use expression to convert your string creationdate to datetime by using below expression,

DateOnly(ToDateTime(@creationDate)) before DateOnly('2023/12/20')

ParthaSarathy_1-1703463148564.png

Avatar

Level 3

It worked!

 

thank you very much as always

 

Kind regards,

Blanca