Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Using a VARS in a query activity filter

Avatar

Avatar
Validate 25
Level 4
salvdangelo
Level 4

Likes

45 likes

Total Posts

130 posts

Correct Reply

4 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 4
salvdangelo
Level 4

Likes

45 likes

Total Posts

130 posts

Correct Reply

4 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
salvdangelo
Level 4

20-12-2017

Hi,

I'm trying to execute a query on nms:broadLogRcp table with a filter @eventDate AFTER $(vars/lastDate)
where  vars.lastDate is a global variable set in JS code in this way:

vars.lastDate = getOption("lastDateOption");
with lastDateOption -> DateTime type

The issue is that I always get 0 results from this query

Query su VARS.JPG


You are able to understand how can I solve?


I believed that the problem was the DATE format, but I use a similar filter with a Integer number and I still get no results
I'm sure that in both the cases the filter shoud give N>0 results

Thanks in advance,

Salvatore

Jean-Serge Biron

Adhiyan

@nkur

kirti.rawat

Adobe Campaign

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
Level 3
saikatk2447661
Level 3

Likes

22 likes

Total Posts

58 posts

Correct Reply

14 solutions
Top badges earned
Contributor
Shape 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
Level 3
saikatk2447661
Level 3

Likes

22 likes

Total Posts

58 posts

Correct Reply

14 solutions
Top badges earned
Contributor
Shape 1
Give Back 5
Give Back 3
Give Back
View profile
saikatk2447661
Level 3

27-12-2017

Hi Salvatore,

Use $(vars/@lastDate) instead of $(vars/lastDate).

Regards

Saikat

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

21-12-2017

Hi Salvatore,

Exact, it is a date format type issue.

Firstly, try to force your variable to have date or datetime format (either in Javascript in the variable declaration, or in the Worfklow properties, Variables tab.

Otherwise use the formatDate or other JS methods to convert to date. But if it is in the Query activity wizard, use the ToDateTime in the Expression editor :

1377965_pastedImage_0.png

Regards
JS