Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

datetime filter marks.

Posted on by Microsoft Employee

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

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

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

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

    check this format

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

  • Suggested answer
    AJAnsari Profile Picture
    AJAnsari 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.

  • Community Member Profile Picture
    Community Member Microsoft Employee 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.

  • Maneesha Profile Picture
    Maneesha 5,889 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
    Community Member Microsoft Employee 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?

  • Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: datetime filter marks.

    You can filter on datetime filed as below

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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans