web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Dynamic date filter Query design

(0) ShareShare
ReportReport
Posted on by

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?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Hannes Holst Profile Picture
    5,767 on at

    Hi,

    give it try with:

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


  • Community Member Profile Picture
    on at

    Works like a charm!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans