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

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)
Suggested answer

datetime filter marks.

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to filter a datetime field using marks. For example "between 'today-3' and 'today'"

In  date fiels '-3d..t' marks are okey but in datetime fields it does not work.

I am seeking  your assists.

*This post is locked for comments

I have the same question (0)
  • Amol Salvi Profile Picture
    18,698 on at
    RE: datetime filter marks.

    You can filter on datetime filed as below

    Temp.SETRANGE(DateTimefield,CREATEDATETIME(TODAY,0T),CREATEDATETIME(TODAY,23.59T));

  • Community Member Profile Picture
    on at
    RE: datetime filter marks.

    Mr. Salvi,

    Thanks for your answer.

    Just i want filter on page (not an development environment) So in date fields (-3d..t)=(between today-3 and today)

    But the same marks didn't work in datetime fields. Which marks do same filtering in datetime fields?

  • Maneesha Profile Picture
    5,891 on at
    RE: datetime filter marks.

    Dear Tarhan ,

    refer the following link : added all Entering Criteria in Filters

    msdn.microsoft.com/.../hh879066(v=nav.70).aspx

  • Community Member Profile Picture
    on at
    RE: datetime filter marks.

    Dear De Silva;

    Thanks for your attention.

    I analyze the link before but did not work at datetime fields.

  • Suggested answer
    AJAnsari Profile Picture
    5,754 on at
    RE: datetime filter marks.

    Tarhan,

    I don't know how to handle additions and subtractions in date formulas in DateTime fields, but short of that, here is how you can filter in a DateTime field when you know the date, day of the week, day of the month, or an absolute reference like Today or WorkDate.

    There are some simple formulas that I've been able to use in the past. For instance, let's say the Work Date is set March 22, 2017, and Today is March 19, 2017. To capture all records between these dates in a DateTime field, I can set this as the formula:

    T 00..W 00

    Here we assume the specific time is insignificant, as long as it falls between the specificed dates. The 00 satisfies the time constraint (I could also have entered it as 0000 or 000000). Counting from the left, the first two zeros indicate hour, the next two indicate minute, and the last two indicate seconds.

    If I want to filter between Monday 1AM and Wednesday 4PM, I can use this formula to filter (I use 24 hour time on my system):

    M 0100..We 1600

    Keep in mind that NAV will treat M (Monday) as the date relative to the Work Date (M of the week of the Work Date).

    For filtering between 03/15/17 and 03/19/17:

    031517 0000..031917 0000

    In fact, NAV will also do just fine if you entered 031517..031917 (since the dates are exact and not relative)

    25th to 29th Day of the Month:

    25D 0000..29D 0000 (or 25D..29D)

    You can read more about this on my blog: letstalknav.com/.../using-date-shortcuts

    Hope I've at least provided some help.

  • Suggested answer
    Maneesha Profile Picture
    5,891 on at
    RE: datetime filter marks.

    check this format

    MM/DD/YYYY HH:MM..MM/DD/YYYY HH:MM

  • Suggested answer
    dkatson Profile Picture
    2,263 on at
    RE: datetime filter marks.

    May be try <-3d>..<CD>

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Saurav.Dhyani Profile Picture

Saurav.Dhyani 2 Super User 2025 Season 2

#2
RK-25090803-0 Profile Picture

RK-25090803-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans