On or before a certain 'Date' using Javascript. | Community
Skip to main content
bhaskarc1289447
Level 3
April 18, 2022
Solved

On or before a certain 'Date' using Javascript.

  • April 18, 2022
  • 2 replies
  • 998 views

Hi All,

 

I have a requirement where I have to get select data from a range of date.

I am currently Using @partyDate >=  parsed_Date in querydef where condition.

But the data being returned is incorrect.

is the syntax correct. How do I pass 'on or after' parsed_Date in querydef where condition in javascript.

Please help.

 

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 Jyoti_Yadav

Hi @bhaskarc1289447 ,

 

Convert both dates to same format and then compare.

You can do something like:

const myDate = formatDate(result.@mailDate, "%4Y/%2M/%2D %02H:%02N:%02S")

 

Thanks,

Jyoti

2 replies

David_Loyd
Adobe Employee
Adobe Employee
April 18, 2022

ACC has its own data format. Check out this link to format the date correctly. 

https://experienceleague.adobe.com/developer/campaign-api/api/f-formatDate.html

Jyoti_Yadav
Jyoti_YadavAccepted solution
Level 8
April 19, 2022

Hi @bhaskarc1289447 ,

 

Convert both dates to same format and then compare.

You can do something like:

const myDate = formatDate(result.@mailDate, "%4Y/%2M/%2D %02H:%02N:%02S")

 

Thanks,

Jyoti