Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

OData filter query

Posted on by

hi everyone - i am trying to figure out how to apply filter to OData call based on a date field. I am using the below to get all the data from purchase order lines where CONFIRMEDDELIVERYDATE  >= today's date but i am getting "bad data request" error.

any idea how to get this to work?

xyzxyzxyzxyx.ax.dynamics.com/.../PurchaseOrderLines$filter=CONFIRMEDDELIVERYDATE ge now()&cross-company=true

*This post is locked for comments

  • SnowShine Profile Picture
    SnowShine on at
    RE: OData filter query

    thank you add - how do i use a dynamic date in there such as today's date?

  • add Profile Picture
    add on at
    RE: OData filter query

    Hello SnowShine,

    I think that the function Now() is not supported. I tried this filter and it works:

    ?$filter=ConfirmedDeliveryDate gt 2017-01-01

    But when I try to use now() it shows this error:

    Unknown function 'now'.

    Note that field names are case sensitive and there is no need for quotes ('') on the date.

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans