Question
Creating audience using datetime fields
Hello!
Do you know how I can put criteria in audience creation section so that I can select those who activated two days ago from current date. I have activation_dt field in my customer table and it datetime format and I also can use current datetime function in Pega. But operating with those two variabels using function difference in days I'm not getting what I want. Be precise using them I need calculate hours and minutes to get what I want. And I wand following thing: my segment is calculating everyday at 7 am, and I want in this segment those whose activation date was the date of 2 days previouse than today. If today 18 of May 2017 then I want in my segment those who has activation_td 16 May 2017 00:00:00 <=avtivation_dt<=16 May 2017 23:59:59 in short those who has date 16 May 2017, tomorrow (19May2017) I want in my segment all those who have activation date 17 of May 2017 and so on
I would appreciate if know clue how I can make it with standart functions that are available in audience creation part.
I'm using pega marketing 7.13, prpc 7.1.9
Thank you!
***Updated by moderator: Lochan to update Categories***
Have you tried using FormatDateTime function? As an example:
@(Pega-RULES:BusinessCalendar).addTime(@(Pega-RULES:DateTime).FormatDateTime(@(Pega-RULES:DateTime).CurrentDateTime(),"yyyyMMdd","America/New_York","en_US"), -2, 0, 0, 0, true, "USDefault")
For example if today is 19th May 2017. Then the above will initialize the date to 20170517T120000.000 GMT.
You can try tweaking the result of FormatDateTime function by passing different format specifiers.