SBX - Search With Button

SBX - Forum Post Title

Dynamic date filter Query design

Microsoft Dynamics NAV Forum

Alfredo Iorio asked a question on 10 Aug 2018 7:22 AM
My Badges

Question Status

Verified

Hi

I am trying to design a query in NAV with dynamic date filters like T-2M..T for transactions happened in the last 2 months

Also to add is a filter like >=T|'' for documents with a date in the future and where date field in empty

I can'r replicate the NAV sintax when applying filters to the query and thought if using SETFILTER in C\AL

I tried the below

SETFILTER(Ending_Date, '>=%1|%2', TODAY, '');

But it only returns records with Ending date greater and equal to today and it does not show the one with no date

Is this a syntax error?

Reply
Hannes Holst responded on 10 Aug 2018 9:50 AM
My Badges
Verified Answer

Hi,

give it try with:

SETFILTER(Ending_Date, '>=%1|%2', TODAY, 0D);


Reply
Alfredo Iorio responded on 10 Aug 2018 11:04 AM
My Badges

Works like a charm!

Reply
Hannes Holst responded on 10 Aug 2018 9:50 AM
My Badges
Verified Answer

Hi,

give it try with:

SETFILTER(Ending_Date, '>=%1|%2', TODAY, 0D);


Reply

SBX - Two Col Forum

SBX - Migrated JS