Hello,
I have a problem with date filter in a query,
This is the code:
filters: { a!queryFilter( field: "fechaVencimiento", operator:">", value: toDate(now()) ),
fechaVencimiento is date of BBDD.
The problem is that when I execute the query it is returning the last two records, while I should not return anything because those records have the current date but not greater.
Do you know any solution for this?
Regards, and thank you very much
Discussion posts and replies are publicly visible
Hi Sandra,
Try to use the function today() instead of now(), because your datatype is a date and if you use a todate(now()) this will return to date and time.
Regards
Hello Karina,
The problem is when the current day is the same as the date if the fechaVencimiento is higher or lower does the checking, the thing is that I want to make the filter for the dates greater than the current day
Hi Sandrap845,
toDate(now()) - This value actually contains date with timestamp. You can check the timestamp by using the below expression:
datetext(todate(now()), "z")
Can you try the below expression and see what is the date returned:
date(year(now()), month(now()), day(now()))
Then you can change your query filter as below and see how it worksa!queryFilter(field: "fechaVencimiento",operator:">",value: date(year(now()), month(now()), day(now())))
Hope this helps
Hi Sandra
Did you use the query editor? maybe with this functionality could help you to test your query and find the problem
https://docs.appian.com/suite/help/19.2/using-the-query-editor.html#create-rule-inputs
hello Karina
I finally deleted the CDT and generating it again worked.