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 :
Small and medium business | Business Central, N...
Answered

API: Format error in $filter of agedAccountPayables by agedAsOfDate

(1) ShareShare
ReportReport
Posted on by 13
Hi,
 
I'm getting a strange error trying to $filter `agedAccountsPayables` (or Receivables) by `agedAsOfDate` as it always tells me the format of the date is wrong.  The exact same format of $filter works for e.g. `purchaseOrders` by `orderDate`.
 
Is this a bug in the API, or something I am misunderstanding?
 
Examples using the Cronus sample database (with some manual word-wrapping for clarity:
 
GET https:/api.businesscentral.dynamics.com/v2.0/{{tenant}}/production/api/v2.0/agedAccountsPayables?company=CRONUS UK Ltd.&$filter=agedAsOfDate ge 2024-02-01
{
  /error/: {
    /code/: /Application_EvaluateException/,
    /message/: /The format of the Date '>=02/01/24' does not match your device's date settings.//r///r/Make sure that the day, month, and year are in the correct order and use the correct separator (such as - or /). Alternatively, you can always use the format 'yyyy-mm-dd'.  CorrelationId:  b750524a-573b-475f-bdbf-6c85024937be./
  }
}
 
GET https:/api.businesscentral.dynamics.com/v2.0/{{tenant}}/production/api/v2.0/purchaseOrders?company=CRONUS UK Ltd.&$filter=orderDate gt 2024-04-08
{
  /@odata.context/: https:/api.businesscentral.dynamics.com/v2.0/070927bf-7189-4b3c-99b5-60f306d9b138/production/api/v2.0/$metadata#purchaseOrders/,
  /value/: [...results...]
}
 
 
You can see that I am indeed sending in yyyy-mm-dd format that it says you can always use, but the error suggests it has internally been converted to US format dates (and my tenant is a UK one).
 
Very strange that it works for purchaseOrders, but not for agedAccountsPayables.
 
Any suggestions would be much appreciated!
 
 
 
I have the same question (0)
  • Verified answer
    RT-01051226-0 Profile Picture
    13 on at
    Worked out my mistake - agedAsOfDate should of course use an `eq` not `gt`.  The error message made no sense, but the error was using the wrong operator in the $filter.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,005 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,148 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans